Last year I rode a motorbike across China to Pakistanhttp://www.advrider.com/forums/showthread.php?t=500053&highlight=dragons+arse
That's quite a trip.
I know I can set CHDK to take pics every few seconds, but can I set it to switch to video and back with a remote? The idea would be to have a time lapse of the ride, but if something interesting pops up I can get some video also.
Yes, this should be possible with some minor scripting.
The trip will be around 50,000km. What are my options with CHDK using external power and storage? That would be a ton of AAs.
Many supported cameras have an external power connector, and for those that don't you can make a battery pack shaped adapter. You can run this from the bikes electrical system with a DC/DC converter. You could also build a larger external pack to feed the plug. You'd still need to recharge, but a couple of NiMH D cells should be able to run the camera for days.
For storage I'd suggest getting a bunch of whatever SD card gives the best price/GB (probably 4GB these days). You may still need external storage depending on what settings you use for the stills and how much video you shoot, but having a bunch of cards means you are less likely to lose everything.
Not to turn you off CHDK, but you might also consider gopro http://www.goprocamera.com/
which can also do both video and timelapse AFAIK. The CHDK cameras all have a lot of moving parts, and aren't really designed to handle thousands South American roads strapped to a bike! OTOH, I know a lot of CHDK users have abused their cameras heavily without problems.