Help with code that is not working correctly

the servo will be used to lock a deadbolt, the switch will detect when the door is closed so the deadbolt only moves when the door is closed, also i ahave already tried it with || with no luck