Without seeing the site it’s hard to say, but you’re trapping the user here:
$w("#searchbox").focus();
$w("#searchbox").onBlur((event) => {
$w("#searchbox").focus()
});
This might be why you have weird interaction issues. What was your idea behind doing that?