Link directly to the first post in an archive

try this ( untested and assuming of course that $tag is the right object tag and $tag[‘count’] is the number of post with that tag ):

if ( $tag['count'] > 1 ) {
 //first part of your code
}
else if($tag['count'] == 1){
  $the_query = new WP_Query( 'tag='.$tag['name'] );
  if ( $the_query->have_posts() ) {
    while ( $the_query->have_posts() ) {
      $the_query->the_post();
      echo '<a href="';
      echo get_the_permalink();
      echo '">';
      echo $tag['slug'];
      echo '</a></br>';
    }
  }
  wp_reset_query();
}
else{
//// last part of your code
}