need help programming value of proximity sensor to sweep servo arm

groundFungus:
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

Ah! I see what you mean. For now I just want to see the servo move, then adjust the parameters to the meet desired range.

I want it to start at position X, then when triggered; move to position Y. Once the value returns within acceptable range move back to Position X

Another way of saying that is when darkness falls, turn on the led and when the sun comes up, turn it off?