How does one maintain balance sleepwalking?
Balance is mediated by 3 things: the cerebellum, vision and the ear via the semicircular canal + vestibular nerve (i.e. the ear).

Sleepwalkers lack the visual feedback, but they have a functional cerebellum and semicircular system which is sufficient. 

As for waking up and feeling disorientated, if that's when you get up fast that's because your semicircular system hasn't yet reset (as well as your blood pressure has just dipped).