To answer some questions about how CHDK does its thing: After CHDK has been installed and is running on a CHDK-capable camera, then a script is loaded from your SD card (in the scripts folder on the card) to make use of the motion-detection feature of CHDK programming. This lightning script was optimized for fastest response times.
If you look at the camera features chart at the CHDK Wiki You'll see that many of the Powershot cameras have motion-detection response times in the 30-100ms range. A lighting strike consists of several well-defined events. First there is the stepped-leader strike. This is the first faint strike that ionizes the air to allow it to conduct the main strike. If it is bright enough, this will be detected by a camera running CHDK with a motion-detection script, then 30-100ms later the shutter will open (response time being camera model dependent).
If you look at the chart on this page of the timing of a lightning events, there are many cloud-to-ground and ground-to-cloud strikes during one lightning strike as it quickly oscillates (like any capacitor discharges). If CHDK can trigger on the 1st or 2nd event, then you have a good chance of capturing all the rest. In most cases, it will capture the 2nd return strike at 62ms (for those models of cameras with response-times faster than that).
The interesting aspect of using CHDK is that for the first time in history you can now take hand-held photos of lightning strikes. You no longer have to leave the shutter open for many seconds while it is mounted on a tripod, all the while hoping that a strike happens during that time. If you set your Lightning Script parameters correctly to account for ambient light levels so it only triggers on anything brighter, then it will automatically trigger the shutter for you only when there's a strike. If mounted on a tripod or just held securely braced against something, it will ONLY trigger whenever there's a lightning strike, resulting in EVERY frame having a lightning bolt captured on it. The biggest drawback to doing lightning-photography this way is sorting through so many captures to pick out the best ones (been there, did that).
More information is available in the CHDK Wiki — follow the section on Lightning Photography...