I usually do this by inserting tags into text. For example:
"Hello, %playername%! You have %coins% gold."
Then replace these tags before displaying the text:
Set t to replace(t, "%playername%", Player.name)
Set t to replace(t, "%coins%", NumberOfCoins)