Code:
#ntacrosssessions off
#ntacrosssessions end

alias nicktracking {
  $iif($group(#ntacrosssessions) == on,.disable,.enable) #ntacrosssessions
  echo -ac info * Nick tracking across sessions is now $group(#ntacrosssessions)
}
alias -l hsh return $scriptdirnicktracking.hsh
on !^*:join:#:{
  if ($hget(nicktracking,$wildsite)) && ($v1 != $nick) {
    echo -bcfilrt join $chan * Joins: $+([,$nick,]) ( $+ $site $+ ) Old Nick $+($chr(3),04[,$v1,])
    haltdef
  }
  hadd -m nicktracking $wildsite $nick
}
on *:exit:{
  if ($group(#ntacrosssessions) == on) hsave -o nicktracking $qt($hsh)
}
on *:start:{
  if ($group(#ntacrosssessions) == on) && ($isfile($hsh)) {
    hmake 50 nicktracking
    hload nicktracking $qt($hsh)
  }
}


This is somewhat less complicated than RusselB's script but should do what you want.

Type /nicktracking to toggle the accross sessions option (which means it will save the tracking table when you exit mIRC and load it when you start mIRC). If this option is off then no data will be saved when you exit mIRC.