To check user groups you would use something like:
Code:
if (is_member_of($theobj->registry->userinfo, 1, 2, 3))
{
// is a member of one of those groups
}
else
{
// is not a member of any of those groups
}
ETA: I had a mistake in that code, it should have been just "userinfo", not userinfo['userid'].
BTW, $bbuserinfo is used in templates (not usually plugin code like this) and is equivalent to $vbulletin->userinfo. Also $theobj->registry is equivalent in this case to the global $vbulletin.