25.03.2021, 14:47
One simple solution is to use a single resident script and poll button state periodically. If the state changes then run the open/close algorithm. Once it's finished then the polling starts again. Just make sure to add a delay between polling (at least 0.5 seconds) so you don't overload the CPU.