Hey there phpprincess, nice to see you here...
Unfortunately, I don't think your method will work as this custom query would be different on many pages (at least 30). Unless I had one really long if statement perhaps?
I did try the exec-php plugin, but in order to use that I would need to disable the Visual Editor, which would negate my purpose in trying retain the editing page feature for the user that will be editing these pages.
For now, I am just using separate page templates, each with custom queries, and each with static HTML. If this needs to be changed by the user, I'll just have to make those changes for now.
p.s. These are category page templates.