S.M.
I always suggest ruling out an ear infection or 2-uyear old molars. My kids only had pain when they laid down. However, for us, they would also fall asleep only to wake up in pain throughout the night. So you could try Tylenol and see if that helps.
But actually, it sounds more like what my 16 month old is currently doing. She won't rock and points at her crib and asks to be put down. She closes her eyes, and as soon as we close the door she bellows. If we even peek in, she is immediately quiet. It would be funny if it wasn't such a pain. My older daughter did a similar thing, and it seems to parallel some insecurity/anxiety things (right now, by daughter is afraid of trucks, planes, thunder, strangers, etc).
So, first, I sympathize. Second, I think it is a control issue. It's not that she is being naughty, she is just trying to figure out how to put herself to sleep and she is testing you, wants reassurance that you are still there even when the door is closed. She is just a smart kid who is thinking it through.
I don't have any specific advice. I don't believe in letting them cry endlessly, even at 2. But I do think you have to be "strict." Reassure her, but don't cater to her. Try talking through thte door "Go to sleep" or walk in and say "Close your eyes, night night." But don't pick her up repeatedly. I'm a sucher and will pick her up if I sense she is genuinely frantic. But ever since she was an infant, my daughter seemed to need to whine a little to get herself to sleep. Sometimes my presence is over-stimulating and actually keeps her up.
Son't know if any of this helps, but good luck.