Ping Pong Blues

Hi there,
I am using this code to move a transform along a spline. I want to add in a ping pong feature, so the object will bounce back and forth between the beginning and end. I think I should use Mathf.PingPong but am unsure where to apply it.

// Make the cube "ride" the spline at a constant speed
	do {
		for (var dist = 0.0; dist < 1.0; dist += Time.deltaTime*speed) {
			var splinePoint = splineLine.GetPoint01 (dist);
			cube.position = Camera.main.ScreenToWorldPoint (Vector3(splinePoint.x, splinePoint.y, 10.0));
			yield;
		}
	} while (loop);		
}

The point would be
var speed = 1.0; // Set as desired
var splinePoint = splineLine.GetPoint01( Mathf.PingPong( Time.time * speed, 1 ) );
in an Update() function, probably not a while loop.