Trying to make a servo flip a switch.

If you give your LDR an appropriate resistor you can condense loop() into two lines. The digital input, being a Schmitt trigger, takes care of the hysteresis. A 10k resistor is a good starting point.

void loop() {
  servo.write((digitalRead(photoSen)) ? 120 : 180);
  delay(5000);
}

You may have to switch the 120 and 180 to make it work the correct way around.