How do i loop a section of the animation?

i have this animation and i wonder how can i loop this part of it,its hightlight in blue and i want to loop it like 4 times with a script

Keyframe marker + editing .TimePosition

animation event or rename keyframe?

Animation marker obviously
Other thing is depracated and is straight up bloat

ok thank you i tested it out and it works