Flip-Flop from analog input?

You could part of it with hardware, and save yourself on the analog reads,
instead of a photoresistor(kinda slow) use an led with a comparator
have a potentiometer to adjust the trip level and the output will be a digital high or low, that will be much faster
in your code just have it once it goes low do something and set a flag to not do anything else
like

If(digitalRead(3)==1 && tripped ==0){
//do something
tripped=1;
}
//or replace digitalread with this for your setup

If(analogRead(A1) > 500 && tripped ==0){//etc and have the 500 number be watever is above abient but below the light

Now the need for speed would only be necessary if watever is tripping it is small and/or moving to fast for the photocell to respond, a quick google says anywhere between 2ms and 50ms response time