a other good solution without automatic redirect is disable the search for guests and add the follow code to your header where your navbar is located
Code:
<if condition="$bbuserinfo['usergroupid'] == 1">
<td id="navbar_search" width="50" height="55"><a href="register.php$session[sessionurl_q]" rel="nofollow"><img src="$stylevar[imgdir_misc]/nav_search.gif" width="50" height="55" border="0" alt=""/></a>
</if>
now they can see the searchbutton but he open the registerpage early or later they will register to be able use the searchfunktion