Okay, this is simple but should do what you want. Tested on my G10.
Save this file as hdr_interval.lua of download from the link below.
--[[
@title HDR Intervalometer
@param t Time between shots (sec)
@default t 10
@range t 1 60
@param f HDR 1/2 stop range
@default f 4
@range f 1 8
@param i Images (0=infinite)
@default i 0
@range i 0 10000
--]]
print("started ..")
image=1
repeat
start = get_tick_count()
print("image",image,"normal")
shoot()
set_aflock(1)
av=get_av96()
sv=get_sv96()
tv=get_tv96()
print("image",image,"bright")
set_tv96_direct(tv-(f*48))
set_sv96(sv)
set_av96(av)
shoot()
print("image",image,"dark")
set_tv96_direct(tv+(f+48))
set_sv96(sv)
set_av96(av)
shoot()
set_aflock(0)
image=image+1
slp=t*1000 - (get_tick_count() - start)
print("shots left=", image, "sleep=",slp)
sleep(slp)
until ( image > i )
print("...done")