Here is the code I use to make sure someone is a member, but you could change 'userid' to 'usergroup' with the appropriate test. I am including the banner so you can see where it fits. But it follows the require_once. I put xxxxxxx in for my account user name for the call to global.php. Hope this helps.
PHP Code:
require_once('/home/xxxxxxx/public_html/forum/global.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
if (!$vbulletin->userinfo['userid'])
{
print_no_permission();
}