Super - I solved the issue
my recursive solution...
FUNCTION processrepeats:seq,loop
LOCAL myline = seq
LOCAL returnline = 0
FOR lp = 1 TO loop-1 // repeat x times
FOR hh = seq TO LEN(actions[])-1 //begin at next command in list
IF actions[hh].cmd$="REPEAT"
processrepeats(hh+1,actions[hh].param)
ELSEIF actions[hh].cmd$="END"
BREAK
ELSE
LOCAL cm AS action
cm.cmd$=actions[hh].cmd$
cm.param = actions[hh].param
cm.id = LEN(exp_actions[])+1
DIMPUSH exp_actions[], cm
ENDIF
NEXT
NEXT
ENDFUNCTION