How to get a repeating, progressing forward backward sequence of a video file?
Perhaps try this:

import os

from bpy import context
scene = context.scene

path = "C:/Users/Admin/Documents/Projects/VIDEO/atabilized/timelapse"
files = os.listdir(path)
files.sort()

# create the sequencer data
scene.sequence_editor_create()

seq = scene.sequence_editor.sequences.new_image(
    name="MyStrip",
    filepath=os.path.join(path, files[0]),
    channel=1, frame_start=1)

# add the images. forward and backwards
amplitude = 25
i=0
while i &lt;= files.len() - amplitude:
    for f in files[i : i + amplitude]: #forward
        seq.elements.append(f)
    for f in files[i + 2 : i + amplitude - 1 ][::-1] #backwards
        seq.elements.append(f)
    i += 1