Update 1.1
I've added to the script the "Close-up Range Detail" option that allows smaller distance steps in the first half part of the shots sequence.
The close-up range can be setted in mm.
The closer subject should result more detailed.
The original idea was to make incremental distance steps with small focus changes in that range.
My poor math and scripting knowledge produced a dangerous brain overheating
so i did it my way.
More, now the FAR point can be setted to infinity via @param.
... sorry for my naive scripts, but it's a side effect of CHDK usage on "not tech" people
ciao