Your best bet would be to use one of the Sony cameras with "Night Shot" mode in them. The F707, F717, F818, H9, or H50, there may be other models that also have it. They can take images in total darkness by IR light alone, or use the IR light for focusing and then fire the flash for full-color "Night Framing" mode. But they don't have motion-detection in them. You can even buy inexpensive (~$40) IR-LED flood-light add-ons for them to extend their IR photography range at night up to 50-80 feet, depending on how many that you use.
If it were me and I wanted to use a Canon Powershot with CHDK instead, I would buy some of those very inexpensive motion-detection yard-light fixtures in most any hardware store. The kind you put on your outside walls that turn on the light as soon as something moves within their range. Often sold as "security lights". Then modify the circuit to use batteries and trigger the camera by the USB remote feature of CHDK. Their sensitivity should cover the distance that can be reached by flash with the camera.