Using millis() and if statement to run ultrasonic sensor and servo motors

The servo sweeps don't appear to achieve very much.

What are they supposed to do?