I'm a doctor.
In the UK it would be perfectly legal for me to walk into a high street pharmacy with my General medical council registration certificate and write myself a private prescription for almost anything I wanted.
The reason for this is that I'm allowed to write private prescriptions for private patients. I'm also allowed to write them for family or friends, or even myself.
If I misused the trust, the GMC would take away my certificate, but that wouldn't stop me from getting what I wanted on any particular day...and if your protagonist is wanting the medication to kill himself he's not going to care about an investigation at some point in the future.
A pharmacist would probably refuse to dispense if I wanted something really odd...like a whole load of painkillers, but if I pretended I'd lost my insulin and needed more I could easily get it. I could even go into ten pharmacies and do it ten times before anyone had chance to check.
I'm not sure if this is also legal in other countries, but any system that has private doctors needs some mechanism for private patients to get medication.
If this is legal in the Us, then you need a reason for him not to do this. He'd have to prove he was a doctor so you need to make him unable to prove that in a high street pharmacy.
To actually answer your question, in the UK, the hospital pharmacy keeps all medications carefully locked away. If a ward has a diabetic patient then they request a small amount on the ward to give that patient day to day. Probably enough to kill yourself with, but if they have no diabetic patient then they probably have either no insulin or a tiny amount. Wards only keep large amounts of common medications, such as aspirin or paracetamol.
On the ward the medications will be either in a locked drug trolley or cupboard. Nurses deal with them. If a doctor asked the nurse for the keys to the drug cupboard and it wasn't in relation to an immediate problem in the ward then the nurse would want to know why. If a doctor asked a nurse who didn't know him, (or knew he didn't work on the ward) for the keys there's no way he'd get them.
If you want to make it hard, then with so many things that could go wrong, it will be fun to write.....but if you want it easy then getting it the boring way in the community is far easier.
Craig