Here is a little tutorial about modifying keyframes during a loop.
I keyframed a cube do make a Y movement from 0 to n. to 0 in 30 frames (n is the variable hight).
Then I click in the timeline on the “Position Y” key that determines the high position of the cube. From the attribute manager I drag that key to the xpresso editor. For this example I fed the value of the key with the frame-number. The result is that at every loop the cube goes higher, because sequence reads the current frame number for the y position.
This trick applies to all the keyframes in a loop and on all aspects of the keys.