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

The positions of what?

That for loop could be replaced by

myservo1.write (180);