How to detect if form-building function is called for the first time?
You can add our own value to $form_state in a hook_form_alter().  If it doesn't already exist (eg., !isset($form_state['my_var'])), then you know it is the first build.