Hmm, maybe something like this?
on *:text:*:#: {
if ($nick isop $chan) { %spamlines = 1 }
if ($nick == %spamnick) {
inc %spamlines
if (%spamlines == %spamline) {
msg # .timeout $nick %spamtime %spammessage
msg # $nick you're spamming too fast. slow down!
%spamlines = 1
}
}
else {
%spamnick = $nick
%spamlines = 1
}
}
This being inside the last half of the code, and I won't say it will work since I haven't tested it.
The basic idea though is you check if they're a moderator and if they are, reset %spamlines back to 1 or just unset %spamlines.