Interesting. I think you are mainly referring to the Portcullis which was the big heavy gate that was dropped in emergencies to allow time for the main gate to be barred and soldiers to take up positions.

It could be set up with counter weights that when certain levers are pulled or ropes are severed the portcullis would drop crushing anyone beneath and sometimes raising the drawbridge at the same time. Quick response that.

Now, this is going to be hilarious and probably will need some logic applied to make it perfect but check out some of the shots of this Lego Castle, a few shots down there are some of the gate area. As you can imagine it would need counter weights that would allow the heavy stuff to be lifted by your average guard on his own but once dropped I expect there was a ratchet system that unless it was released you were not going to move anything.

Obviously, this is Lego but it might help a lot with what you need. Besides, who doesn't love Legos?