Try use this code:

Syntax: !voice <nickname> <#channel>

Code:
ON *:TEXT:*:?: {
  tokenize 32 $strip($1-)
  if ($1 == !voice) {
    if (!$2) { .msg $nick Error, Please specify a nickname! | return }
    if (!$3) { .msg $nick Error, Please specify a channel! | return }
    if ($avoice($2 $+ !*@*)) { .msg $nick Error, This nickname is already exists! | return }
    .avoice $2 $3 $network
    .msg $nick The $qt($2) nickname has been added into the autovoice list for $qt($3) channel into $qt($network) network.
  }
}


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-