How to script the motion blur shutter curve?
I'd suggest read the values and create a dictionary out of point positions per frame, which allows to structure as well as access the values in a reasonable way:
dict = {
    frame_number : [
        (LOC_X, LOC_Y), 
        (LOC_X, LOC_Y), 
        (LOC_X, LOC_Y),
        ...
    ]
    frame_number : [
        (LOC_X, LOC_Y), 
        (LOC_X, LOC_Y), 
        (LOC_X, LOC_Y),
        ...
    ]
}

One pitfall is that the minimum point count for a curve is 2, means that you can not remove all the points of any existing curve.
The following demo sets the shutter curve based on custom data. Notice that set_curve() is a slightly modified version of the reset_curve() function from this Q&amp;A:
import bpy

frame_dict = {
    1: [(0.0, 0.0), (0.07, 0.5), (0.25, 0.9), (0.5, 1.0), (0.75, 0.9), (0.92, 0.5),  (1.0, 0.0)],
    2: [(0.0, 0.0), (0.125, 0.44), (0.375, 0.95), (0.5, 1.0), (0.625, 0.95), (0.875, 0.44), (1.0, 0.0)]
}

# Based on 'reset_curve()' from https://blender.stackexchange.com/a/64461/
def set_curve(curvemap, custom_points):

    curve = curvemap.curves[0] # Get the curve
    # Remove redundant points
    if len(curve.points) &gt; len(custom_points): 
        n = 0
        while len(curve.points) &gt; len(custom_points):
            curve.points.remove(curve.points[n])
            n += 1
    # Generate missing points
    if len(curve.points) &lt; len(custom_points):
        n = 0
        while len(curve.points) &lt; len(custom_points):
            curve.points.new(0.1, 0.5)
            n +=1
    # Set the values and update UI
    for c, point in enumerate(curve.points):
        point.location = custom_points[c]
    curvemap.update() # Optional call


C = bpy.context
shutter_curve = C.scene.render.motion_blur_shutter_curve

# test call
set_curve(shutter_curve, frame_dict.get(2))


In order to set the curve and render each frame, go through the key-value pair of the dict and call Scene.frame_set(your_frame) per iteration to update the scene:
for frame, points in frame_dict.items():
    # Set the curve
    set_curve(shutter_curve, points)
    # Set the frame
    C.scene.frame_set(frame)
    # Render the frame
    bpy.ops.render.render(write_still=True)

Alternatively you can setup a frame_change_post handler which allows to preview and set your values on the fly, when changing the frame in the timeline (before rendering):

def set_curve_frame(scene):
    shutter_curve = scene.render.motion_blur_shutter_curve
    if scene.frame_current in frame_dict:
        set_curve(shutter_curve, frame_dict.get(scene.frame_current))

bpy.app.handlers.frame_change_post.append(set_curve_frame)


Related:

Can python access control points of Hue modifier?
Python Render Specific Frames