How do you position a custom search box in the main menu?
Menu Inject Block module was built exactly for the same purpose.


  This module allows you to inject blocks as menu items. It facilitates easier use of JavaScript based dropdowns and panel like navigation. Most users employ this module to create dropdown panels using other modules to handle the dropdowns and this module to inject the blocks as needed.


To use this module:


Enable the module
Create or Edit your menu item (/admin/build/menu)
Enter in  for the Path
Give your menu item a Title
Select a Block from the "BLOCK TO INJECT:" drop down (in your case the search block).
Save your menu item


You don't need to create a separate search block in case you use the module. You can place the default search block that Drupal provides, into step 5 mentioned above.