Antanaclasis is the term used to refer to the repetition of a word or phrase (or a similar word or phrase) that means something different each time it is repeated. Often antanaclasis is made possible because the word is used literally and figuratively in the same text.
"Put out the light, and then put out the light." Othello, by Shakespeare Othello will put out the candle, and will kill Desdemona.
"And there's bars on the corners and bars on my heart." Tim McGraw Literally, in the city there are bars, and figuratively his heart is captive in the city. He sings about waiting to live "where the green grass grows."
The woods are lovely, dark, and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep.
"Stopping by Woods on a Snowy Evening," Robert Frost
The first "And miles to go before I sleep" is usually taken to refer to physical miles and physical sleep. The repetition is more figurative-many years to go before his death.
Your argument is sound ... all sound. Benjamin Franklin
The first sound means reasonable. The second sound means just noise.
While we live, let us live. Latin Quotation
The first "live" means while we are alive. The second "live" means to really make the most of life.
Literary Terms Examples