The Principal of Lex Talionis (Law of Retaliation, i.e. Eye for an Eye)
is also found among other societies, not just Babylon and the
Israelites. particularly among many tribal societies, where such
precise punishment helps disolve any tensions over perceived
unfairness in the criminal's punishment.
Afterall, what could be fairer (in terms of equal value) than giving
the perpetrator the exact medicine he gave?
It's also a great deterance to future would-be offenders.
Interestingly, the early Sumerians don't seem to have practiced
this law. Mostly using the principal of compensation.
One more point, unlike othe rlater, more "constitutional" laws,
these early laws of the Bronze Age and early Iron Age, were
probably not very strictly enforced, and may not even have
been meant to be enforced in everyday situations.
Old Testament. When Jesus came things changed though...so I wouldn't worry about it. Refer to the new testament about Turn the other cheek. It may not be as easy, or as satisfying, but in the end, you won't feel like a barbarian, and most importantly, won't risk hell...which'd hurt alot more than a smack to the face...