Hmmm.... this is a tough one to answer. Perhaps use of the MESSAGE BUTTON will help! Also opening a gate is rather easy to, SWITCHES MY FRIEND! Use switches!
Well to solve your prison problem you simply either edit the prison bars in the database so they are on Countertop, (same goes with tables, booths and stuff) or just make an invisible event outside the bars but in front of the guy behind them, set the event to action key, then have your message saying "Hi, why you in prison Blah Blah Blah"