Well... it looks like I've managed to create code that returns all the required results specified in your list.
I had little free time for further optimization, but I hope this will be enough and everything will work good.

Try testing this script code:
Code
alias addnick {
  if ($1) {
    if (@ !isin $1) {
      var %nick $remove($1,*,!), %chars $remove($1,%nick)
      if ($left(%chars,1) == *) { echo -ag Return: $+(%nick,*!*@*) }
      elseif ($left(%chars,1) == !) {
        if ($istok(! !*,%chars,32)) { echo -ag Return: $+(%nick,!*@*) }
        elseif (%chars == !*!) { echo -ag Return: $+(%nick,!*!@*) }
      }
      else { echo -ag Return: $1 }
    }
    else {
      if ($left($1,1) == @) { var %nickident *!*, %host $remove($1,@) }
      else { var %nickident $gettok($1,1,64), %host $gettok($1,2,64) }
      var %nick $remove(%nickident,*,!), %chars $remove($1,%nick)      
      ;----------
      if ($istok(!@? !*@?,%chars,32)) { echo -ag Return: $+(%nick,!*@?) | return }
      elseif ($istok(@! @? @*!,%chars,32)) { echo -ag Return: $+(*!,%nick,@,%host) | return }
      ;----------
      if ($numtok(%host,46) < 4) { var %host $+(%host,*) }
      if ($left($1,1) == @) || ($left(%nickident,1) == *) { echo -ag Return: $+(*!*@,%host) }
      elseif ($left(%chars,1) == *) { echo -ag Return: $+(%nick,*!*@*) }
      elseif ($left(%chars,1) == !) { echo -ag Return: $+(%nick,!*@,%host) }
      elseif (%chars == @) { echo -ag Return: $+(*!,%nick,@*) }
      else { echo -ag Return: $1 }
    }
  }
}


🌐 https://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples