My father worked as a building superindendent for a few years and owned a cleaning company for several more. Due to these jobs he spent an lot of time in them, using them, moving heavy equipment in them, understanding how they work and with all that time in them... getting stuck as well. It's this experience that he passed along to me. I remember him telling me that whenever he got stuck in an elevator he would pry the doors open and climb out to the closest floor.
It's due to this advice that I've been able to not have to wait for building security to open the elevator doors for me. I've been stuck 3 times so far and each time I've been able to open the doors and get out. Twice I was alone and the third time I asked the group if it was OK to do so. For some reason they didn't seem to mind. The trickiest part is to get a good grip on the door which can sometimes be difficult, especially with those shiny stainless steel doors. Pressing hard enough while pulling the door open with your fingertips just enough to slip your fingers into the opening and from there you can pull the door open.
Thanks for the advice dad