Ok, it works with aflock! I didn't see that set_aflock(1) make an AF cycle...
I was getting crazy also trying to use the "set_aflock" function. As you say, it seems af_lock performs one autofocus cycle. On my A610, that piece of script doesn't refocus (focus is actually blocked).
set_aflock 1
n=0
while 1
n=n+1
press "shoot_half"
sleep 2000
get_focus x
print "Enfoque", n, x, "mm"
release "shoot_half"
wend
But that other one will always refocus (notice set_aflock is continuous being called and then an AF cycle being performed):
n=0
while 1
n=n+1
set_aflock 1
press "shoot_half"
sleep 2000
get_focus x
print "Enfoque", n, x, "mm"
release "shoot_half"
wend