In the modified 9', ten sections of shelves, 12" wide and 2' long would leave you a full 3' for at the door. Knock the two front corners off 3/4 in from each end and 2-1/2" back, and they'll almost touch. At the back, they'll gap enough for a 2x4 upright flat against the wall. Run the shelf support "rungs" flat, and there would be more than enough support for the shelves. If paranoid about them flipping out, run a screw in near the front on each end.
In the unaltered 8', still ten sections of shelves, but now cut them at 21-1/2", and knock half of each end off at 30 degrees. On the supports, now the edge is against the wall. If you half lap the shelf supports it would look something like this.
In either case there would be a surprisingly small gap at the back. Certainly less that shelves on an open stud wall, and people do that all the time.
I wouldn't bother with a loft, I'd just run the shelves full height and keep a 6' stepladder in there. Use it folded and leaning on the shelves. Two steps before the top and you'll be hitting your head, and still have the top of the ladder to hold on to.