Is your custom page in the same directory as your forum (where global.php is)? If so, you should be able to call print_no_permission() if they aren't logged in and it should redirect back to your custom page after login. For instance, this test program works:
Code:
<?php
include('./global.php');
if ($vbulletin->userinfo['userid'] == 0)
{
print_no_permission();
}
else
echo "Hello " . $vbulletin->userinfo['username'];