The way i would probably do it is..
1a. Check the cookie and see if the user is logged in. If the user is logged in, then the comment fields can go up, no problems there.
If the users ISNT logged in:
2a. Display the form that i posted earlier in this thread (with a message saying "login to post a comment" or similar). This form will hand all the authentication duties over to the proper vBulletin scripts (member.php).
2b. Have the login auto-redirect back to the main page, and the user will be back, with the correct cookie, and stage 1a above will occur!
Use this hidden field in your form, this is what the member.php script will re-direct the user to if he logs in successfully:
PHP Code:
<input type="hidden" name="url" value="http://your.site.com/">