I argue that it's grammatical (I will address whether it is the best of the two shortly) through the following evolution:
"What does the door do?" ⇒ "Close [does the door]." ⇒ "[The door does] close." ⇒ "Close."
This is a bit clunky, granted, compared to "The door closes." (which would lead to "Closes."), but grammatical nonetheless.
Regardless of the above, I think the shortened response "Close." is actually the best response because of this. The original question "What does the door do?" triggers in my mind a question-response pattern used often with children or in children's books.
- — What does a horse do? — Gallop.
- — What does a dolphin do? — Swim.
- — What does a door do? — Open/close/swing.
- — What does a phone do? — Ring.
- — What does a policeman do? — Fight crime.
The verb or verb phrase becomes infinitive-like and bypasses any subject-predicate agreement in number. Not only is this most natural of the two choices (I argue), it is through its use itself grammatical (though specialized).
Even though this is a pattern used around children, it still feels valid in my mind for adult conversation because the question itself ("What does the door do?") is very simple and carries with it, regardless of speaker, a child-like and innocent tone that invokes this specialized grammar. I believe I've even seen this pattern of speech during game shows or trivia, where simple one or two word responses are all that are allowed.
I only compare "Close." with "Closes." as those were the only two options given. Though among those choices I argue in favor of "Close.", if other choices were allowed I'd instead argue that "It closes." or "The door closes." are most natural of all. But as it stands, it is important to remind that "It closes." is not the same response as "Closes.".