Maybe this would be a bit easier to understand? With the addition of a function that gets the next step?

$step = NULL;
do {
   $step = islandora_ingest_form_get_next_step($form_state, $step);
} while(isset($step) && $step['type'] != 'form');
return !$step;