Code:
alias ping .msg $1- PING $ticks $+ 
on *:TEXT:!Ping:#:ping $nick | set -u120 %pingchan. $+ $nick #
on *:CTCPREPLY:ping *:{
  var %a = $calc(($ticks - $2)*.001) seconds
  if $eval($+(%,pingchan.,$nick),2) {
    msg $ifmatch $+(04,$nick your ping reply was:[12,%a,04] I am on server:[12,$server,04])
    unset %pingchan. $+ $nick
  }
  else echo $color(ctcp) -seti $+([,$nick PING Reply]:) %a
  halt
} 
%pingchan.nick is set for 120 seconds, this should be more than enough as with any greater lag they (or you) would probably be reconnecting by then, and enables the var to never be kept on close/exit.

This also allows ms ping times for "normal" /ping <nick> commands.