'ischan' will just check of the channel name s in a valid format, not whether you were on it or not. You might want to check if:
Code:
if ($chan(#chaco-corrientes)) { echo $v1 ... }


As to whether you can 'msg' a channel in a DISCONNECT event, I'm not sure. I'd have thought it was too late. You're probably better off re-aliasing the '/quit' command.