If you want to play a sound when you disconnect then use on DISCONNECT. on EXIT is triggered when mIRC closes, so it can't play a sound for long then (unless put it into an loop for a while).
Also the if in locutus' script isn't really needed. If you're going to distribute the script you will also probably want to use $shortfn($mircini) instead of mirc.ini, since not all users use mirc.ini (they might use bob.ini or jim.ini depending on who is using it).