I use this code in one of my hacks to add template code using a plugin:
Code:
$search_text = '$navbar';
$vbulletin->templatecache['FORUMHOME'] = str_replace($search_text,
$search_text.fetch_template('temp_with_code_you_want_added'),$vbulletin->templatecache['FORUMHOME']);
I got it from one of Zacharia's posts somewhere on here... anyway, back to the point.
Basically, just replace the $navbar with a string from a template, in my case I'm using forumhome, if I'm understanding what you're trying to do, then I think you'd want to use the same. Try replacing $navbar with "$vbphrase[x_members_and_y_guests]</phrase>)".
Then create a template with whatever code you want and put the template name in the plugin.
Code:
<br />Invisible Users: $var
I've got the plugin running on forumhome_complete. Hope this is of some help to you.