You can combine all of that into a single condition...
PHP Code:
if(($vbulletin->options['on_off']) AND (!empty($vbulletin->options['profileid'])) AND ($user['userid'] == $vbulletin->options['profileid']))
{
standard_error('Sorry...');
}
Are you sure [minicode]$user['userid'][/minicode] is the correct variable, maybe it should be [minicode]$user
info['userid'][/minicode]?
Use
print_no_permission()