There are several ways to do it. The gates (yes, they are gates, not doors) are units with commands, so if the player "owns" one, it can order it to open/close. The ways you describe has to be done via triggers, though.
Example:
EVENT: Any unit enters region "Keycard".
ACTION: Set variable "Keycard found" = true
And then...
EVENT: Any unit enters region "Open door"
CONDITION: Variable "Keycard found" = true
ACTION: Issue order to gate to "Open gate".
Explanation: The variable is basically like a switch between "True" and "False". It should be a boolean variable that is initially set to "False". When player finds the keycard, you set it to "True", and then the door opens the next time he approaches the gate. Remember that each gate has a different "Open gate" command, though. For instance, the Destructible Gate won't open if you use a "Security Gate - Open gate" command, for instance.
Also: Some, if not all (can't remember), of the gates are destructible. If you want them to behave like doodads, simply check "Unselectable", "Invulnerable", etc. in the data editor for the units, under "Unit".
0.950642054574639