Can anyone explain why and how to resolve?!
That's a fairly simple script, intended as an example rather than a fully functional shooting script.
Documentation for the motion detect function can be found here :http://chdk.wikia.com/wiki/Motion_Detection
Typically, to solve your problem you want to increase the threshold value (f) and start delay (p). This will respectively change the amount of image change necessary to trigger a shot and add a small delay for the camera to "settle" before looking for motion after each shot.
Try f=40 and p=1000 as a starting point. You will need to edit the script file. It might be better to convert the script to set those as user parameter like this :
@title Motion Detect
@param f = sensitivity
@default f 40
@param p = interval (msec)
@default p 1000
md_detect_motion a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p
if( h > 0 ) then