So I took over letting them out and in. I'd open each stall one by one. The farthest away first, they'd mostly walk out if there was no one else with them. To let them in i'd squeeze through the door gap and call them over; they'd come running and find me and a closed door. I'd have to single one out and keep the rest back (i carried a short whip in case they got too close and too pushy); i'd open the door, let one through then close the door behind me. I'd make sure each one was secure in their stall before I let the another one in. It worked pretty well.
It got to the point where they each knew where to go and would walk in calmly one behind the other, find their stall and go in. I'd just walk up behind them and close each door.
Now my horse has moved and is brought in from his field with a buddy. He knows to stand facing away from his food in his stall so his halter can be taken off before he eats. If he pulls or gets obnoxious he has to wait a few minutes before i'll take his halter off so he can eat.