My 29 inch guy is in a 7x8, it's smaller than I wanted but all the room there was, he fits great with lots of room. I would go bigger if you had the room though(8x10-12 would be GREAT) especially if he's going to be in overnight. I like to make the door high enough for them to get their heads over easily but only their heads. About 3'.
We've always had 12x12 stalls in every barn. It's a good size for when a mini has to be kept indoors for several days and also is good for foaling out.
I agree with Taz that the gate height should be just high enough for their heads so they can see out, but NOT jump out.
I think that the horse being able to see out and there being plenty of light so they don't feel like they are trapped in a cave is as important as size. My stall is one end of my barn, with four gates, so one solid (barn)wall, a gate on each end that opens into a paddock on one side and a 10' x 20' lot on the other, a gate in the middle to divide it into two stalls, and one gate into the barn. They can see into the barn and out each side. So that gives me an option of an 8 x 10 or 8 x 20 stall, with or without an outside run. I also have a carport that I built a 5' wide and a little over 5' tall lean-to on one side for my tack and my mini likes to lounge in a 5' section on the end. She has the whole carport and over an acre, funny girl.
Our stalls are built from a lean to off the side of a shed. They're 6' wide x 6 ½' deep x 6½' tall at the lowest point. These guys right now are about 35" and 36" tall. They shouldn't grow much more. Here's the setup for now:
They're roomy enough, but still cozy enough for them to lay down to sleep at night, even though they're pretty open right now. They seem pretty happy with them though, they even have enough room to roll when they want to.
Our horses obviously don't mind the cozy sized stalls, but it probably depends on the horse how much room he "needs." If yours is used to a bigger run in or being in a regular size stall, normally 12' x 12', he might want more room. We made our doors, but you can buy metal, wood, plastic or a netting style gate or door for your stall. There's a lot of choices and sizes. Ours are as wide as the stalls, so 6' each, and 3' tall.
You didn't say how long your shed is, but if you're going to build a lean to type stall off of it you might as well use the entire length. You could have a large stall for foaling, 2 stalls if you decide to get your horse a buddy later on, or a supply room next to the stall if he's got plenty of room and is happy in a smaller stall.
Before it gets too cold, our stalls are getting a redesign, though.
We're going to add stall mats, dutch style doors, and windows we can open and close as necessary depending on the weather. (We're in Indiana).
We want them to always be able to see outside, and get good airflow when the weather is mild, but they'll need more protection from the nasty weather we get every winter, so we'll be getting started on that soon.