Proverbs 26:27: "He who digs a pit will fall into it; he who rolls a stone will fall back on him."
We're all familiar with poetic justice, whether it be in books, movies, etc. We all love to see the evil villain punished by the foils of his own cunningness. Well, the Lord also enjoys poetic justice - a cursory reading of the Book of Esther proves that much in the "villain" Haman - his plans to deceive Mordecai and the Jewish people all come back to haunt him as he tastes the bitterness of his own demise.
Solomon gives some sage counsel here to avoid the deceptions of our own sin.