I'm not so sure about that, just because you are up in my face doesn't mean I can't blow you away with a pistol, and in fact it will make it much easier for me to hit you (not accounting for things like nervousness or panic, which would be best accounted for in a separate system).
Actually, if you have a gun, you shouldn't go closer than three to five meters to someone you are threatening. Closer than that and he has a good chance of grabbing your gun and turning it aside. (This is what they constantly do wrong in movies/TV.) So I guess in this game, could you make it so shooting at the square next to you allows using Melee/Dodge against the shot? I'm not sure if zombies should be able to do it though, I mean, are they smart enough to defend against firearms?
As someone passingly familiar with self-defense with firearms, being in close quarters with a pistol isn't going to affect your chance to hit too much. Sure, you'd rather have the target be far away, the better to not be killed by them, but you're not going to be taking a shooter's stance if they're close to you. That's just inviting them to swat the gun out of the way. You'll be drawing your gun back to your side, holding it with one hand, shooting from the hip. Shooting from the hip is
usually a bad thing, but within ~15 feet they're so close it's almost as simple as point-and-shoot if you're familiar with your gun.
I could see making a penalty for untrained weapon handlers and with guns that aren't ideal for CQC (Such as long rifles), but it should quickly degrade as you've gained skills in the weapon you're using (Except where it makes sense that the gun would be harder to use in CQC, where your idea makes sense).
Building off of that, if the game should recognize when you've missed several times in a row and warn you about any penalties that may be screwing with your aim. This would solve the problem that people have been running into with unskilled characters by giving them feedback as to why they're not hitting, rather than leaving them to guess.
For example:
"You miss. Your clothing is getting in the way..."
"You miss. Your lack of skill makes using this weapon in close quarters difficult..."
"You miss. Your lack of skill makes using this weapon at long ranges difficult..."
"You miss. Chemicals are hampering your performance..."
"You miss. Your target is particularly hard to hit..."
"You miss. Nothing seems wrong... Maybe you're just unlucky?"