That sounds like an interesting idea. To be clear, are you suggesting this as a feature directly for end users? So for instance, when you have the bookmarks sidebar open, you can type special keywords like
And are you suggesting doing this by writing an add-on, rather than directly modifying the Firefox front-end code?
If so, then I think... high-level APIs like WebExtensions don't (yet, and perhaps won't ever) enable you to modify arbitrary bits of the browser UI. So if I were you, I'd experiment with this by writing a separate "better bookmark manager" WebExtension using the bookmarks API.
I think searching bookmarks by tags is not implemented yet, but there is a bug on file about it.
(FWIW I think there's a lot of potential for a really good bookmark manager add-on.)