
Max M. answered 04/08/19
Harvard Literature major with 20 years of coaching writers
I'm working on this one, and while I'm quite familiar with Shakespeare, this isn't exactly registering. I did a little research, and it looks like this one has been nagging at you for a while, so let me see if I can help.
First, to echo two other comments you've gotten, the most similar scene to me is Merry Wives of Windsor. Falstaff is trying to seduce two married women, and they trick him into hiding in the laundry basket by saying one of their husbands is coming back early. Then he gets dumped in a ditch. He never says anything exactly like the "save me but punish me" line, but from his perspective that is in effect what they're doing. He ends up going back for more, but the second time, he won't go in the laundry basket, so they dress him up as an old servant woman, but he still gets chased out of the house being hit with sticks. That may be where you're getting the idea of the character becoming a servant as part of the "deal." Again, there's no line that specifically uses the "save / punish" dichotomy, but the broad strokes match.
If not, my best backup guess is As You Like It--Rosalind dresses as a man to escape the bad duke. While in disguise, she befriends her real lover Orlando, and asks him to pretend "he" is Rosalind to practice wooing her. While Rosalind is pretending to be a guy pretending to be Rosalind s/he gives Orlando a very hard time. Early in the play, Orlando says to Rosalind (not in disguise): "I beseech you, punish me not with your hard thoughts." Later, after disguised Rosalind has been torturing him, Orlando says (but several characters also say it), "Why blame you me to love you?" There's no deal to be a servant, and no real "saving" going on, but she is seriously messing with him.
Second, if you're quite sure that's not it, I'll echo the point another commenter made and say that what you're describing doesn't really feel like a Shakespearean trope, especially if it's not a comedy. Making protection deals isn't really something he gets into, and usually when characters hide (e.g., Polonius in Hamlet, Oberon in Midsummer, Iachimo in Cymbeline) or disguise themselves (e.g., Rosalind in As You Like It, Viola in Twelfth Night, Edgar in King Lear), it's their own idea. The "quick, behind the curtains!" type scene your description suggests belongs more to melodrama, a word I don't mean as a bad thing, just as a different genre. Moliere sometimes does stuff like that (though I can't think of a scene from his work that exactly matches your description off the top of my head), and Restoration playwrights do also, though again, for primarily comic effect.
Third, if you're not buying any of this, and you're sure it's Shakespeare but not Merry Wives, here's a (probably incomplete) list of other plays that have hiding and disguise in them.
Twelfth Night--Viola dresses as a man to keep herself safe. She falls in love with the Count Orsino, and the noblewoman Olivia falls in love with her/him.
King Lear--Edgar disguises himself as mad Tom while being falsely accused of conspiring against his father.
Measure for Measure--The duke disguises himself to see how his kingdom is really run. Also, Angelo visits Isabella in secret, but she certainly doesn't save him.
Cymbeline--Iachimo hides in Imogen's bedroom to spy on her and convince her husband she cheated on him.
Tempest--Prospero makes Ferdinand do hard labor for him before he'll consider Ferdinand a match for his daughter Miranda. This is actually the only play I can think of that has a character agreeing to work for someone to achieve a larger goal.
Hamlet--Polonius and Claudius hide to spy on Hamlet. Later, Polonius hides behind a screen (arras) in Gertrude's room when Hamlet comes in.
Merchant of Venice--Jessica disguises herself as a boy to avoid detection
If and when you figure it out, please let me know--I always like hearing how these things work out!