Proverbs 26:27
25 When he speaks graciously, do not believe him, for there are seven abominations within him. 26 Though his hatred may be concealed by deceit, his evil will be uncovered in the assembly. 27 The one who digs a pit will fall into it; the one who rolls a stone—it will come back on him. 28 A lying tongue hates those crushed by it, and a flattering mouth works ruin.
Ecclesiastes 10:8
6 Fools are placed in many positions of authority, while wealthy men sit in lowly positions. 7 I have seen slaves on horseback and princes walking on foot like slaves. 8 One who digs a pit may fall into it, and one who breaks through a wall may be bitten by a snake. 9 One who quarries stones may be injured by them; one who splits logs may be endangered by them. 10 If an iron ax head is blunt and a workman does not sharpen its edge, he must exert a great deal of effort; so wisdom has the advantage of giving success.
Notes and References
"... One example of the reapplication of a proverb is Proverbs 26:27: “He who digs a pit will fall into it / and he who rolls a stone, it will return to him.” The context of the proverb is in a cluster of proverbs about the impact of the verbal wounder. His speech is a lethal weapon. But the verbal abuser faces adverse consequences in the end. His abusive ways will come back on him. The one who schemes against another will himself suffer the repercussions. The first line of this proverb is used in two other texts outside Proverbs. One is in Ecclesiastes 10:8 and the other is Psalm 7:15. In Ecclesiastes 10:8-9 the proverb is as follows: “He who digs a pit will fall into it / and whoever tears down a wall – a snake may bite. He who dislodges stones may be hurt by them / and he must take care who would chop down trees.” Most commentators say that Ecclesiastes chapter 10 is made up of a series of unrelated proverbs. However, they at least seem to be clustered in smaller units made up of two or three verses. Verses 8-11 may be one such cluster. Using a series of analogies the proverbs speak to the idea of retribution. Misconduct will bear its own fruit ..."
Bland, Dave L. A Rhetorical Perspective on the Sentence Sayings of the Book of Proverbs (p. 218) University of Washington, 1994