The on UDPWRITE event should normally not be used, as it has no purpose when using UDP. That is why it is not documented. However, it exists in the code for debugging purposes, so it might help you track down the issue.
I have rechecked the source code and cannot find any situation where a socket will be closed without triggering a script event. There is no code that closes a socket just for idling.
If you find a way to reproduce the issue reliably, please let us know.