I use the same strategy: “Stop … or
“I’m going to throw you out the window.”
“Make you sleep outside with the squirrels.”
Saying it in a serious tone of voice will get them to think just long enough to realize “you’re just kidding”, laugh together, and move on from whatever was bothering them.
But when worse comes to worse and they keep at it, you have to proceed with the physically appropriate follow-up: pick up the kids and move to defenestrate.
Or in the case of my favorite, “Tickle you until you cry,” move right into the borderline painful fingers-to-ribs-and-pits technique.
Use sparingly and be quick to escalate the magnitude of the threat. Works every time.