you could create a callback function that is called every time a timer expires. Within that function you could get the position of your cars and calculate the distance between them. If they are to close you could speed up the one in front and slow down the one behind.
Code:
import vizmat
#start a timer that will call onTimer() every 2 seconds
viz.starttimer(0,2,viz.FOREVER)
def onTimer(num):
car1_Pos = car1.getPosition()
car2_Pos = car2.getPosition()
distance = vizmat.Distance(car1_Pos, car2_Pos)
if distance is too close:
#increase speed of path of car1
#decrease speed of path of car2
viz.callback(viz.TIMER_EVENT,onTimer)
is that helpful?