Unless we're thinking of two different episodes, that's exactly what happened.
The one I'm thinking of is episode 6.10 ("The Fish Guts Displacement").
Amy: But our relationship agreement clearly states that when one of us is sick, the other must take care of them.
Sheldon: Oh, no, I see the confusion. No, the intent behind that clause was to force you to take care of me when I’m ill. When you’re feeling better, you’ll think that’s funny.
Amy: Never mind. Good night, Sheldon.
Sheldon: (Knock, knock, knock) Amy. (Knock, knock, knock) Amy. (Knock, knock, knock) Amy. I made a commitment in writing to comfort you in times like this. Additionally, you are my girlfriend, and I care about your well-being.
Amy: Thank you, Sheldon.
Sheldon: You’re welcome. Now let’s get this over with.