Oops, I left out the part where you set $num_grp_members (I think I originally posted it like that then edited the post to fix it). Also, you should use <br /> instead of \n. So, try this:
PHP Code:
global $vbulletin;
if ($result = $vbulletin->db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "user WHERE usergroupid = 12"))
{
$output = "We currently have " . $result['count'] . "<br /><a href=http://www.mysite.com/forum/payments.php> Upgrade now</a>";
return $output;
}