When you attack a lever, that means it dies. When the lever dies, you open/close/destroy the gate. You can set the lever back to alive then if you want to use it again. In that case, make a If/Then/Else command with a boolean condition that checks if the gate is opened or closed, and make the Then Actions open the gate when it's closed, and close the gate when opened.