need help programming value of proximity sensor to sweep servo arm

So you want to move the servo to 90 degrees then right away move it to 70 degrees? Why not just move it to 70 to start? What do you actually want to with the servo? The servo.write function does not wait for the servo to reach the new position, it just sends the signal and you must have a delay long enough for the servo to move to the new position before sending it to another position