The ctcp reply is not in the channel so you cant use $chan
use #channelname
and you should put some extra brackets in
_____________________________________________________
on *:text:!pingme:#:{ ctcp $nick ping } }
on *:ctcpreply:*ping*:{
if ($2 == $null) { halt }
var %pt = $ctime - $2
if (%pt < 0) { %pt = 0 }
.msg
#channel $nick 4Your Ping reply is: [12 $+ $duration(%pt) $+ 4] I'm your ping servant.
}

}
__________________________________________________
____
parts in red are the changes