If by 'moderator' this means you are on Twitch, that network does not always do everything in the standard IRC method, so not all commands work the same. For example Twitch recognizes the Whisper command, but not the Notice command.

If 'moderator' means an Op who has the @ symbol next to their nick, the :TEXT: event can begin like:

if ($2 isop $chan) { msg # command failed, $nick cannot target that user $2 | return }

Where you have "/timeout $2 " does that mean you are wanting to display that text to channel? Or are you trying to limit people from using the command too often? Such as having a 60 second period where that same nick cannot use the !command again, but also have a 30 second period where nobody at all can use it?

By "extra command response", do you mean that it randomly replies with 2 different responses, where one is longer than the other? Or that it sometimes responds with 1 message, and other times it responds with 2 messages?