The question should have been "whom do you want to log for?" As napa182 stated, it's a safe bet to have a flood control. Last but not least, you need to make sure the person you are logging for exists:
on $*:text:/^!log/iS:#:{
if !%x {
inc -u4 %x
if !$2 {
msg # Whom do you want a log for?
}
else {
msg # $iif($strip($2) ison #,$timestamp $+(<,$2,>) $3-,$2 is not on # $+ !)
}
}
}