You need to make sure the block doesn't show up on the registration page, because you would go into an endless loop if it did, since the block does a redirect.
In otherwords, your registration page must not show the block area that you've placed the Guest Page View Limit code. Try putting it in a centerblock and make sure centerblocks are turned off for your forum page. Or, if you normally turn off right blocks when in your forum, use a right block. The registration page is part of the forum, so simply put the code into whatever block you "do not" have showing up when in your forum pages.