I wrote a small script for some purpose, but I can't actually remember what it was now. But when I was using it, I found it is very effective in avoiding ping timeouts. So, I just kept it and renamed it Anti-ping timeout.
Basically what it does is sends a private message to myself every 5 minutes. Whats great about it is that it runs completely in the background, so i don't get a private message window popping up all the time. I have just made a timer which sends me a message every half an hour saying it's still active. I tested it for 3 days constantly connected to a server. Only once did it ping timeout while the script was running and that was only because my ISP was down for maintenance or something. Tested it without the script and within 20mins it had timed out. So it obviously works at least to some extent.