Hospitalization can help with finding the right medication because things can be changed more quickly than with outpatient. Doses can be increased every day instead of every week. Medications can be switched easily. And your response to all this is closely monitored until they think they've found a good solution.
They didn't mess around with my medication too much while I was inpatient. The only thing they did was try out a couple different ones to help me sleep, and they were successful after a few days. Too successful at one point. They knocked me out so I was basically drunk the next day. But that was fixed the next night.
I came to this thread planning to say it's not helpful, but now it looks like my opinion is actually the exact opposite.