It would be easier if there was a moat because you can add a draw bridge with chains leading into the brick wall with a gear set mechanism with a winch leading in a small gate house on the inside courtyard. Another idea is to cut away inside the stair wall area where a chain pulley system is located. Usually theres a small gatehouse 5-10 feet wide and deep containing the winch with a small thatched roof to prevent the elements from effecting the mechanism and causing rusting of metal parts. Not sure if all this located under the roof on top the gate. I'll draw out my idea if you want real quick to give you an idea.