Why not just have iron gates that only open from inside? A real castle/city wall defence would have that.
"One can concentrate so closely on the words of a sentence that one thereby misses the meaning. As can happen in any area of life. You must never lose focus on the larger landscape."
That's what i was planning, 2 gates, if you aren't trying to kill everything you can go into the "hallway", there are gaurds who question you who you are and what you want, if you are evil, you will die in a painfull death concluding arrows