No the issue being is that vbportal probally never defines this statement
$vbulletin->userinfo['usergroupid']
which means vbportal does not have the element needed to check permissions hense your using the coded block outside of its normal intention for what it is coded for which is why I suggested you post in the mod corner forums for mod help maybe someone knows what variable that software uses to house the usergroup permissions or grab them. In the
vb software for 3.5/3.6 it is definately
$vbulletin->userinfo['usergroupid']