how to implement hook_menu so that it recognizes URL like ?q=myterm, as sent by jQuery autocomplete?
hook_menu() don't handle query parameters. It accepts only wildcards.
You can get your query parameters in in your menu callback function and build your own logic by getting parameters as $_GET['q'] or drupal_get_query_parameters()