You may want to read this, even if it's a bit technical: http://chdk.wikia.com/wiki/CHDK/Camera_RAM_memory_usage. In a nutshell, it seems it's possible to run out of RAM by shooting too many images and that it's possible to make that happen sooner rather than later by e.g. not starting the script right after power-on, which could explain both the crash and the variance in your mileage...
How quickly does your camera power on to play mode with normal responsiveness when you have 13000 photos on the card? Mine takes its time...it's around 15 seconds compared to normal instantaneous boot.
Ah, but I'm a brain-burned, mad, technical person
Play mode is very slow starting on A590 like you found, cam sits there flashing green LED near viewfinder for a long time, also the windoze Zoom program refused to communicate -- plugging in a 'doze or linux USB cable made the camera issue "Communications Error" and refuse to talk -- however Zoom program has no problem reading the SDHC card in a USB reader.
As far as A590 recording images, it creates a new /DCIM/???CANON directory each 2000 images. Cam is up to /DCIM/110CANON now.
I'll clear the image files before each timelapse session now. The crash happened during a second session where I hadn't cleared the image files from first session. Was also using the 1600x1200 timestamped image option.
Soon I'll rewrite my timelapse script to use the clock rather than tick counter for low drift, also want try Lua. My chdk page is
http://bugsplatter.id.au/chdk/ where I'll dump info as I discover it. Also plan to measure power consumption in various modes. One day do my own builds, list is endless