Does the fact that the hot shoe of the camera was used affect the functionality of the script?
IIRC, anything fully inserted in the hot shoe could cause problems. I believe doing so has been shown to disable CHDK's ability to override exposure settings - at least for some ports.
See :
Using CHDK Commands and Operation for Hot Shoe Flash and
Problems overriding shutter speed on SX40 for a couple of examples.
This was discovered some time ago and a fixed tested as a side effect of this forum thread :
Flash hot shoe - override the switch.
An optional CHDK menu item was added such that cameras with a hot shoe also have a menu choice in the CHDK
Enhanced Photo Operations menu called
Hotshoe Override that allows you to disable the sensor switch in the hot shoe ( the switch that detects when something is inserted in the hot shoe).
So far, it's only enabled for the G7, G10, G12, SX10, SX20, SX50, and s5is. And not for the your G15 (or my G16 for that matter - or the SX60). It might make sense to add to these cameras too but doing so requires someone to do some testing on the actual camera to figure out which bit in the I/O in the keymap is the HOTSHOE_FLAG.