While Book of Exodus may be a major bringer of "eye for an eye" to western culture, it is certainly not the origin of the principle. The Hammurabi code predates the events described in the book of Exodus (and thus the book of Exodus) by many centuries, and does encode "Eye for an eye" as a literal prescription (If an citizen should blind the eye of another citizen, they shall blind his eye.)
So it was also a prescription - but yes, as you say, it is also a limitation for retaliation, assigning an equivalent punishment to limit escalation of vengeance.
One must wonder if its host nation-state had survived for longer, what iteration would be out in the wild.