This is done in songs and I'm sure it's done in poetry too.
For example, in the song Gray and Blue by Jaymay, she sings, "I'm with another boy (he's asleep, I'm wide awake) / And he tried to win my heart, but it's taken... time." The pause leads you to believe her heart is taken (it is) but then she follows up and changes the meaning to be "it's takin' time".
This trick delights me but I don't know what it's called.
Also, sometimes further context doesn't change the meaning but the word is just perfectly ambiguous. An example of this is in The Park by Feist. "You thought that you saw him, but no you did not" The no could just as easily be "know." Does this have a name?