Button for closing blinds not working

It is very hard to troubleshoot code when the format and indents / spacing is not legible.

It would help us help you of you could format the code as per the FAQ.
How to help us help you - or How to ask a good question.