It looks to me like you're reading in a line that's returning a $null value. Try this little modification
Code:
on *:sockread:telnet: {
  if $sockerr { echo -a $sockerr | halt }
  else {
    sockread %hd.info
    aline 15 @telnet $ansi2mirc(%hd.info)
  }
}