This is how I think It could be done.
- Set camera to bulb mode. So that the shutter stays open as long as the shutter button is pressed.
- Set flash to fire either at the first / second curtain.
- Press the shutter button when the people start to move the light source and release it once the movement is complete
As you realize, I've not specified what ISO or Aperture is needed... this is where you need to experiment.