Try this :
on *:SOCKOPEN:*:{
set %snake $?!="A socket tring to open, close the socket?"
if (%snake == $true) {
var %sockname = $sockname
sockclose %sockname
}
if ((%snake == $false) {
halt
}
}