Not a script, but can be done with some external electronics.
Basically, you have a flip-flop that is set by a remote pushbutton.
This initiates the capture sequence which is started but paused.
The sound is detected by a microphone and the flip-flop reset.
This has the same effect as releasing the switch and the photo is taken about 20msec later.
This can be done in full daylight if you wish and even with two cameras for stereo.