Ah, yes, I see the the error now. The vBulletin template parser is interpreting "$(this)" (+ others) as a PHP variable, which it is not. (The error is thrown because it contains characters that are deemed invalid in a PHP variable.) Try this instead:
HTML Code:
<script type="text/javascript">
\$(document).ready(function(){
\$('#mainMenu > li').hover( function() { \$(this).addClass('hover') }, function() {\$(this).removeClass('hover')});
});
</script>