I've been looking at something similar with the data base queries in the addons. I't sems to me that it would be easier (and faster) to combine some of the queries and then set up a loop to create arrays out of them. Then just use a loop in a template to echo out the html / array data (kinda like the way the postlist and showflat / showthreaded pages work).
The addons also use some of the same variables, so I'm consolidating all of them into an "addon.inc.php" file. No sense in wasting time creating the same variables over and over...