Actually, no, I'm still not sure if I understand correctly .. You *don't* want the script to work in the channel #whatever? Or you do want it to work there? Is this script only intended for one channel?

Anyway, this is what you could try from what I think I grasp. :P

Note: Make sure that you clean out %pchan and %pnick before you start using this script. /unset %pchan,%pnick

Code:
On *:TEXT:!pingme:*:{
  if ($chan == #whatever) { return } 
  var %tok = $calc($numtok(%pnick,46) + 1)
  .ctcp $nick ping
  .set %pnick $instok(%pnick,$nick,%tok,46)
  if (#) { .set %pchan $instok(%pchan,#,%tok,46) }
  else { .set %pchan $instok(%pchan,none,%tok,46) }
}
On *:TEXT:!pingus:#:{
  .ctcp $chan ping
  var %i = 1, %tok = $numtok(%pnick,46)
  while (%i <= $nick(#,0)) { 
    set %pnick $instok(%pnick,$nick(#,%i),$calc(%tok + %i),46)
    set %pchan $instok(%pchan,#,$calc(%tok + %i),46)
    inc %i
  }
}
On *:CTCPREPLY:ping *:{ 
  var %pt = $calc($ctime - $2)
  if ($istok(%pnick,$nick,46)) {
    var %loc = $findtok(%pnick,$nick,1,46)
    var %chan = $gettok(%pchan,%loc,46)
    .notice $nick Your lag is %pt seconds.
    if (%chan != none) { msg %chan Your lag is %pt seconds, $nick }
    set %pnick $deltok(%pnick,%loc,46)
    set %pchan $deltok(%pchan,%loc,46)
  }
}
On *:DISCONNECT: unset %pchan,%pnick

Not sure if this is going to work since I can't test it. However, I hope that you get the general idea.


"Any sufficiently advanced technology is indistinguishable from magic." - Arthur C. Clarke