The mariner compares himself to the snakes because until he is able to bless the snakes "unaware" he has no appreciation for their beauty. Before, he looked as them as "slimy things" and did not recognize that he, too, is a slimy thing for taking the life of the beautiful and innocent albatross. After he describes the snakes as beautiful and full of lovely color--blessing them unaware--the albatross falls off and the mariner, too, is blessed. For eternity, he is destined to protect "all creatures great and small" because "the Lord God made them all" and no one like himself should carelessly take the life of any of them. He is punished and blessed simultaneously to educate others like himself not to take for granted the importance and beauty of all living things.
It is in Part IV, where the Mariner, all alone on the ship and suffering because of having killed the albatross, finally sees nature for its beauty. He describes the snakes in lines 272-281 as moving in "tracks of shining white" and as having "rich attire: / Blue, glossy green, and velvet black" and as moving with a "flash of golden fire". Before this the snakes and other creatures in the sea were described as "slimy things" (l. 125) because he did not yet see them as part of the natural world with as much right as he has to be in the world. It is at the end of Part IV, after having described the water snakes, that the albatross finally falls off the Mariner's neck. He is free now that he has come to appreciate all of God's creatures. The water snakes he describes are free and are moving with beauty and grace which the Mariner himself now can do since he has come to his new realization.