GalanAleni:
How can I stop it from happening more than once?
You need to be clear about what 'it' is.
If 'it' is just to light one or other LED according to the distance, move your current code into setup so it only executes once.
If 'it' is to wait for the distance to increase above your threshold and then do some other action (but only do it once) then you need your sketch to remember whether the action has been taken yet. The simplest form of that would just be a boolean variable that you test before doing the action, and set when you take the action.
if((distance > threshold) and bridgeRaised)
{
lowerBridge();
bridgeRaised=false;
}
However, based on the problem you describe I suspect you'll find this is only the start of what will be a much longer sequence controlling the whole crossing process, and you would be better off using a finite state machine to control the whole sequence. Robin2 posted an excellent example sketch demonstrating a recommended way to implement finite state machines a few weeks ago, so I suggest you find and read that thread.