Controlling servo with light sensor

Hello all
I am trying to program simple robot but I am facing a problem with programing it

What I want the robot to do is to strat the servo on Angel 0 and when the light sensor detect light bigger than 450 turn the servo to position 90 and wait till the light goes under 450 and turn the servo back to 0 and wait again till the light sensor detect a light bigger than 450 but this time turn the servo to Angel 180 and wait until the light goes back under 450 and turn the servo to 0
And making this in loop for ever


arduino ldr servo tutorial