I dont know if this will help, but this is what I have learned.

on *:Sockread:sockname:{
if ($sockerr > 0) { return }


sockread lines



:error
if ($error) { echo -s $error | reseterror }
}

Notice I use return instead oh halt. This is so mIRC doesn't halt all currently running scripts. Only the one that has the error.