PHP Puzzle: Unique Styles with PHP loop

To are still call database inside the by get_post_meta() where you already have the values in $custom_fields variable. Try something like this:

 <?php

    $custom_fields = get_post_custom($post->ID); 
      for ($i = 1; $i <= 4; $i++)  {
       if(isset($custom_fields["rw_location_$i"][0])){ 
        if($i==1){ echo '<h1>';} else {echo '<h2>';}
        echo $custom_fields["rw_location_$i"][0] 
        if($i==1) {echo '</h1>'; }else {echo '</h2>'};
       }
    } 
  ?>

If I get your question right. Are you looking to echo <h1> for the first iteration and <h2> for all other iteration?