There are many devs doing this, it's actually very simple. Instead of writing "Lisa" in the text, he just puts a variable each time the name is supposed to come up.
So the text goes like this:
"But Y, you're my X!"
At the beginning when the player is asked to input the name, the name will be attached ot the variable Y, when he inputs the relationship, it will be attached to X. So the game will automatically say whatever the players choose at the beginning.
And since NLT isn't responsible for what people type in in private, and nobody knows anyways, there's no issue at all.