One of the mantras of my old comedy writing mentor, Danny Simon was “Never sacrifice the reality of a character for a joke.”
In other words, if it would be funny—even REALLY funny—for your character to stand up to mugger but he’s not the kind of person who would do that, don’t have him do it. Either find humor in his genuine response, or change the set-up so that there’s a reason why this time he stands up to a mugger even though he normally wouldn’t.
Of course some genres depend on people doing what no sane person would do—for example, horror pictures in which a lone woman ventures down into a dark cellar when she hears alarming noises down there. But even in those, the ones that work best create a reason why she must go down there.
And if you are stuck because you don’t know what the character would do, that’s a sign you don’t know the character well enough. Go back and daydream about that person—where did they grow up, what were their parents like, what was their dream, what has hurt them in life, what do they want more than anything else? When you can answer a hundred questions like that, you’ll know what they’d do next.
(There are lots more tips on writing, from idea through to publication, in my "Your Writing Coach" book and you can get it from Amazon, Barnes & Noble, and other online and offline stores.)