How to replace anonymous comment form with a registration form on wordpress?

On the comment form page if they are not logged in send a 301 redirect to the registration page. (wp-login.php) Pass along a GET variable with the current page and use it in a function like this: Registration Redirect Function. Wrap it in an if statement checking for the GET variable. Then redirect to that url in the variable.

So when they go to comment they are taken straight to the registration form, then once they complete the registration they are taken back to the comment field.