I've never used a DLL to make a connection to an IRC server, but I believe you have to send the USER 3 times

Send the USER parameter first then nickname.

Might be an idea to check the DLL documentation it maybe you only need to send USER once and the DLL strings it 3 times.

Code:
alias irc { sockopen irc irc.mysticirc.co.uk 6667 }

On *:Sockopen:irc: {
  sockwrite -tn irc USER $str($+(Andy,$chr(32)),3)
  sockwrite -tn irc NICK $+(Andy,$rand(1,999))
}

on 1:sockread:irc: {
  if ($sockerr > 0) return
  :irc
  sockread %irc
  if ($sockbr == 0) return
  if (!%irc) %irc = -
  echo 2 -a  $gettok(%irc,2-,58)
  goto irc
}


There's an example.

Type: /irc

-Andy