Not just early in the session. Since you're flushing the cache every time you search for something, the more blocks you have, the longer the search takes, because this code creates *every* block template newly every time you search for something.

Yes, searching the block sources would not find buttons and toggles. Those could be special cased, however. After all, the information when to create a toggle etc. is there.

I'd also really, really love it, if the search results wouldn't go away again, when I click on another category. Or, if I could have several different search results around. That's why I'd love to keep these around in a dialog box. Of course, that box would have to be closed whenever you switch to a different sprite - or maybe not (ssh, don't tell, this is something nobody has yet found out about, hehe) -, so it's also a bit tricky.