Are you using these in a PHP file or in a template?
If you're straight-up editing a PHP file, you might want to consider using vBulletin's Plugin System rather than directly modifying your Index.php file -- but, I'll show you anyway as it's the same concept in either option.
PHP Code:
if (is_member_of($vbulletin->userinfo,1,2,3)) {
// php code to execute if user is in usergroupid 1, 2, or 3
}
PHP Code:
if ($vbulletin->userinfo['username'] == 'JohnDoe') {
// php code to execute if the username is "JohnDoe"
}