Teach the wait command. Set aside an hour or two, put the dog on a leash, and open the coop. The instant the dog goes to move, close the door. Rinse repeat until the dog stops moving to enter the coop and instead looks at you when the door is open for at least a second. Praise and treat.
Keep working up to longer and longer durations, adding the verbal cue to wait. Once the dog clearly responds and recognizes the verbal cue to wait to mean "I don't move or the door gets slammed in my face", add a release word. My dog responds to "Okay", pick any word you want so long as you won't inadvertently say it and release the dog before you want him to move. You'll want to start out by tossing a treat AWAY from the coop, make sure it is incredible, we're talking hot fresh bacon here, so he'll go for the treat and not the coop. Keep working him like this til he knows not to break "wait" until he gets his "okay", phasing out high value treats as he gets better and better.
Do not take the dog off lead until the dog is reliably waiting with the door wide open for at least half a minute. This may take a few days, it may take a few weeks.
Once the dog can reliably handle this while on lead, remove the lead. Start from the VERY beginning. It's important not to get ahead of yourself here, because the key is to set the dog up for what YOU deem as success. Don't give him the chance to fail and praise him like he is God's fuzzy gift to the world in whatever way he likes best, but don't get him excited. Keep things calm and warm and matter of fact.