Menu access callback function called multiple times
Drupal forms are clever enough to know whether or not they've been submitted in the current page call and can react accordingly. Your best bet would be to move your code logic to inside the form function, where I think you can check for $form_state['#submitted'] to decide whether this code runs or not.

Alternatively you could check for the existence of $_POST variables in the MYMODULE_menu() function.


  Check and read it out $form_state['cache'] = true; from here.


Hope that helps.