A read of the Pyramid Text of Unas, Spells for Protection of the Mummy (Burial Chamber, West Gable) is the first recorded instance (that I am aware of) that calls for one snake to neutralize another snake (of an enemy). This was later brought into the myth of Moses whose snake ate the Pharaoh's snake. See text below.
"RECITATION. Your two drops into the earth! Your two ribs into the hole! Shoot liquid and the two kites will stand up, your mouth will be closed by the executioner’s gear, the mouth of the executioner’s gear will be closed by Mafdet, and the one made slack will be bitten by Plait.
Oh, Sun! Bite for Unis the earth, bite for Unis Geb, bite for Unis the father of the one who would bite him! This one is the one who would bite Unis the instant after he sees Unis; Unis did not bite him. He is the one who came against Unis the instant after he looked at Unis; Unis did not go against him.
You bite Unis, (snake), and he will give your one (biter), you look at Unis and he will give your second (biter). Plait has been bitten by a plait, a plait has been bitten by Plait.7 Sky will entwine, earth will entwine, the Male who turns around the subjects will entwine,8 the blind god will be entwined, and you yourself will be entwined, scorpion.
These are the two spells of Elephantine that are in the mouth of Osiris, which Horus has cast on the (snake’s) spine."
From James P. Allen's _The Ancient Egyptian Pyramid Texts_ (2005: 17).
Notes:
5 In Middle Kingdom copies this set of spells is entitled “Spells for barring Rerek in the necropolis.” For Rerek, see the Glossary.
6 The word “Plait” here refers to a snake, and is derived from the verb used of plaiting rope: the image is that of one snake neutralized by another. In the second clause the snake is likened to a newborn calf without teeth.
7 The image here is the same as that in Spell 1 (see n. 6).
8 A reference to the sun or the living king.
9 “Bone” here refers to the snake’s fang. In the next sentence, the fangs are called “pillars” in the snake’s mouth (“the kiln’s place”).
10 The snake is likened to a penis that produces
"RECITATION. Your two drops into the earth! Your two ribs into the hole! Shoot liquid and the two kites will stand up, your mouth will be closed by the executioner’s gear, the mouth of the executioner’s gear will be closed by Mafdet, and the one made slack will be bitten by Plait.
Oh, Sun! Bite for Unis the earth, bite for Unis Geb, bite for Unis the father of the one who would bite him! This one is the one who would bite Unis the instant after he sees Unis; Unis did not bite him. He is the one who came against Unis the instant after he looked at Unis; Unis did not go against him.
You bite Unis, (snake), and he will give your one (biter), you look at Unis and he will give your second (biter). Plait has been bitten by a plait, a plait has been bitten by Plait.7 Sky will entwine, earth will entwine, the Male who turns around the subjects will entwine,8 the blind god will be entwined, and you yourself will be entwined, scorpion.
These are the two spells of Elephantine that are in the mouth of Osiris, which Horus has cast on the (snake’s) spine."
From James P. Allen's _The Ancient Egyptian Pyramid Texts_ (2005: 17).
Notes:
5 In Middle Kingdom copies this set of spells is entitled “Spells for barring Rerek in the necropolis.” For Rerek, see the Glossary.
6 The word “Plait” here refers to a snake, and is derived from the verb used of plaiting rope: the image is that of one snake neutralized by another. In the second clause the snake is likened to a newborn calf without teeth.
7 The image here is the same as that in Spell 1 (see n. 6).
8 A reference to the sun or the living king.
9 “Bone” here refers to the snake’s fang. In the next sentence, the fangs are called “pillars” in the snake’s mouth (“the kiln’s place”).
10 The snake is likened to a penis that produces