Closing a solenoid after a set time interval ends

What happens before:

else if (L2_run) { // Solenoid 2 is supposed to be open

? What does:

RunWateringSequence();

And:

AllVaulvesOff();

Do? Post entire code.