Adding the @ to the editbox would make things more complicated if it turned out that you needed to press <tab> more than once before reaching the correct nick.
Instead of changing the editbox to contain the @ character, this waits until you've pressed enter. If you're pasting something, or press Ctrl+Enter, or type a command that begins with / then this event will ignore that. But otherwise, if the 1st word is a nick in channel it will add the @ to it.
Note that when this script takes action, that message in channel won't contain multiple consecutive spaces. You can change # into
#channelname
or
#channel1,#channel2
if you want this behavior only in 1 or several channels.
ON &*:INPUT:#:{ if (($ctrlenter) || ($inpaste) || ($left($1,1) == /)) return | if ($1 ison #) { msg # @ $+ $1- | halt } }