The command is
strip.modifiers.new('your name here', 'STEPPED')
documented here. The below example adds a modifier to the currently selected strip.
# get the currently selected strip
cur_strip = bpy.context.scene.sequence_editor.active_strip
# add a modifier to the strip
new_modifier = cur_strip.modifiers.new('your name here', 'STEPPED')
Also, you're getting the
failed, context is incorrect error message because I believe all the
bpy.ops.XXX commands need to be run while the mouse is in the correct area (in this case, the video editor). Since your mouse is in the scripting console, it errors. So you would need to run the below command. Unfortunately usually doing something in the video editor, then looking at the command in the scripting console gives you the non-console friendly
bpy.ops.XXX version of the command.
bpy.context.area.type = 'SEQUENCE_EDITOR';<your command here>;bpy.context.area.type = 'CONSOLE'
I'm using Blender 3.0, I don't know if its different in Blender 2.X