OK, I hate to give up, so I actually went to the test site and tried this (which I should have done from the start and saved us both time).
I made this plugin and used the hook member_profileblock_fetch_unwrapped
Code:
if ($this->template_name == 'memberinfo_block_statistics')
{
global $vbulletin;
$count = $vbulletin->db->query_first("SELECT COUNT(*) AS count
FROM ".TABLE_PREFIX."thread
WHERE postuserid = ".
$vbulletin->userinfo['userid']."
AND forumid IN(164, 165, 166)");
}
Then in the template I just used $count[count]. This avoids the global variable problem because the hook is in the same place as the template eval.
Sorry I wasted your time before, this time I *really* quit