Excuse me if that's was already suggested. I spend 10 mins searching though posts and haven't find any one suggesting this.
So the person who has a key to the gate can allow/disallow gate to be closed with out a key.
Let's face it, players will always abuse mechanics and use alts for holding keys, so why not to make things a bit more convenient?
The real-life scenarios:
* I want to protect some place I have CR to, so I wall it. I don't want to hang around with keys on me, when I have to walk out through the gate, but have no choice except creating new alt for a key storage...
* I want to go forage, but why should I take keys since there's and option to port to your hearth?