Make path move like snake in snake game
The following code moves each point in the curve ahead one spot.
So the second point moves to where the first point is, the third to the second, and so on.

All you need to do is decide where the first point needs to be moved next.

import bpy

# Assumes your curve is the only one in the scene.
curve = bpy.data.curves[0]

items = curve.splines[0].points.items()
point_count = len(items)

for index in range(point_count - 1, 0, -1):
    current = items[index][1].co
    previous = items[index - 1][1].co
    current.x = previous.x
    current.y = previous.y
    current.z = previous.z

first = items[0][1].co
first.x -= 1


The final part moves the first point to the new position.
So you could do first.x -= 1 for left, first.x += 1 for right, and first.y -= 1 for forward.
This is making assumptions about the orientation of the scene, so you should adjust x, y, and z to suit your scene.

This code is very simple, but hopefully it is enough to get started.