a more pragmatic approach would be to introduce a new event prefix to have on OPEN/CLOSE trigger in response to commands, as well as what they currently do:
on ~*:OPEN:?:*:{ ; triggers for all query window openings }
as such, compatibility with older versions is fully preserved