Jonesy:
Using $network was considered but dismissed because often I am connected more than once per network so it seems easier for me to know what is lagging if it is per nickname. Also consider that the way it is written it creates one lag test timer per server connection but using $server would be even more difficult to figure out what was lagging. It is useful to test each server connection and not just each network connection however, if you wish to change it to $network then also consider changing the on connect event to match as well:
on *:CONNECT:.timerLag $+ $network 0 55 ping $!ticks
You will also need to edit the menu items to match. To be honest I only use the Check Lag Now menu item and provided the other items to make it appear more complete.
This is about the 10+ lag test version I have written over the years including one version that averaged lag over time storing the values in a hash table so as to calculate average lag to too many decimal places. After all this i arrived at the following conclusions: