I took a look at the source code and I somewhat understand how it basically works. When Insomnia is enabled/on, it stays running in the background kind of like a daemon until you toggle it off from Springboard again. When idle sleep is about to start (30 seconds), Insomnia sends a keepalive to the Power Management system to prevent the device going to idle sleep.
Overall, this is a very handy app for IM, IRC, iRadio, VNSea, and basically any other app that requires a constant Internet connection. It's quite convenient to use as you can toggle Insomnia on/off right on the Springboard by just tapping on its icon. Note: It WILL increase battery usage for obvious reasons, so keep that in mind.
The developer is the same one who works on the haptic keyboard app:
http://www.tuaw.com/2008/02/26/iphon...totype-debuts/
http://code.google.com/p/iphone-haptics/ (notice the same project owner in both Insomnia and Haptic)