Help with simple photoresistor chicken coop project

So the there are some comments in the usual pretty short way which is not my style.

I second that you should use self-descriptive names for everything.

in a state-machine you could program a timeout that works this way:

start motor to close the door. With starting the motor store a timestamp into a variable.
let the motor run and in parallel do a repeated calculation how much time has passed by

Let's assume that closing the door normally takes 10 seconds
If something goes a little hard it may take 15 seconds but not 20

So you are "measuring" how many seconds is the motor running?
This measuring is done by calculating
actual_time - startTime

if the result reaches 20 seconds and the corresponding switch hasn't switched yet
switch on yellow LED to indicate there is something wrong with closing the door.

The same thing can be done for opening the door.

To be able to do such things you have to learn

two

new things

  1. non-blocking timing
  2. how state-machines work

You are requesting a pretty advanced functionality. And this pretty advanced functionality means to learn pretty advanced programming techniques.

Stay relaxed. Even for a machinist as you are this is easy

if

the steps to proceed are small and the eplanations are easy to understand.
I have written two tutorials about that who claim to explain it as simply as possible.

Whether it is really easy to understand needs to be checked by newcomers like you.

When questions arise, please ask those questions. Your questions will help me to make the explanation even easier to understand.

So here are the links to the tutorials

best regards Stefan