Thank you for this script! I had to add:
SetKeyDelay for the left and right pedals to respond consistently.
I am still trying to figure out how to do a loop with the pedals. I would prefer it to keep doing 3 second jumps while the pedal is pressed rather than having to keep pressing it.