>> This particular example is another way of asking “what would Jesus do?” <<
.
We never needed to ask that question if we read the gospels.
He showed what to when encountering wanton sin: He fashioned a whip and thrashed the animal sellers and money changers off the temple porch single-handed.
Whenever he encountered sin he rebuked it.
.
And what did He say to those who were about to stone to death a prostitute? What did He say to her?
We don't see things or our own behavior as He does and I have a growing fear for the day when He shows me my life through His eyes.
There is a moment between stimulus and response where we actually can choose what our response will be or simply react.
In that moment, should we even notice it, it is helpful to remind ourselves of Scripture, as you point out, especially by asking that simple, succinct question "What would Jesus do?"
Usually, the answer is not the same as our immediate reaction. Obviously, we should keep the letter of the Law, but it is equally important to remember His Spirit of the Law as He taught: Love, Grace, Mercy and Forgiveness.