You also ideally don't need $calc(%ping) with the way you're using the script, since mIRC automatically calculates equations stored in local variables (although you aren't setting a local variable, you really should for scripts of this nature.).
Also as napa182 pointed out, it appears you ripped the code from another script... :/
Ex:
var %ping = $ctime - $2
.timer 1 2 echo -s 4 ..:: I have -> $duration(%ping)of lag:in server $+ $server ((AUTO PING MADE BY Lingo))::..