On door open - Logic problem

I still don't think you've fully explained the problem you're trying to solve here and all of the scenarios inside. I think you're (understandably) trying to explain it using limited programming knowledge.

Can you try explaining the problem your project is trying to solve and your proposed solution, in as great detail as possible using little to no programming terms?