Just as an additional note: I do understand the consequence of this logic block is the same compared to what I have described above. However its very hard to comprehend / maintain because the variables do not hold the states their names imply and the logic is trying to do too many steps at once.

Safe code is simple code, not compactly written code 8). Please also add line comments to describe what a block does or intents to do for critical logic blocks like this one.