Gateway level namedQuery?

I want to run a named query within a Tag Value Changed event script. This script will run at Gateway scope, so if I have my named query defined in my project, I have to hardcode the project name in the call to system.db.runNamedQuery

Hardcoding the project name is offensive to me, but I can’t see how to define a named query at a gateway level. Am I missing something? Or is there a different way of doing what I want to achieve? (My plan B might be to define a tag that contains the project name where the namedQuery is. Still ugly though, Plan C might be making my project the Gateway Scripting Project and putting my SQL queries into the Project Library. Is this a good idea for a project that only has tags and no visualization?)

(I want a named query because I want to call it from a large number of tags and only want to define it in the one location.)