I am using a Pico remote to activate two garage doors controlled by a Zen17. Pressing any of the buttons 1, 2, 4 0r 5 will append a number after the variable lock - security string, which starts with a value of 0. So pressing the top button once will append 1 to the string making it 01, pressing the bottom button appends a 4 making it now 014. After pressing the correct buttons, then pressing the center button will raise the correct garage door if it is currently closed. Any time the center button is pressed, the variable lock - security string is reset to 0. This works properly for both doors, opening when the proper code is entered and pressing the center button.
However, if the center button is pressed while the variable lock - security string is 0, should close the doors if they are open. This is not working properly, as only one of the door closes. What do I have wrong in my logic?
Here is the button that does the heavy lifting in a more readable format (I think.)