Cleaning stalls in like my job, so here's what I'd do in your situtation. ;)
Firstly, I will not go in the stall with the horse if I am not comfortable with it. If you're nervous, the already nervous horse will pick up on it. The horses I stay away from are the pacing, screaming, jumpy ones. If they're worried about something, they're not going to feel a thing when they run you over. So, if that's the case, I'd get the horse out, then clean.
It's much easier to a clean stall without a horse in it, but with horses that are staying in 24/7, waiting until they're turned out is impossible. With babies and youngsters, I find that they're always full of curiosity. They follow me around in the stall, usually very closely, and sometimes try to grab the scooper and/or wheelbarrow/bucket. I somewhat allow them to be near me, but if they're in the way, I'll push them away. Same for if they start grabbing the scooper. Basically you kinda have to teach them to respect your space and your tools, even though you're in the stall with them because it's really hard to clean when they're standing right on their poop. xD
So basically, for every horse it's different. I'd go into the stalls with the calmer horses and take out the hotheaded ones. You'll begin to get to know the horses and if you take the time after cleaning their stall to pat their shoulder or find their itchy spot, they'll all adjust to you and eventually you'll probably be able to clean all the stalls with ease, with a horse in it or not.