What you want are dialog variables. You create them in the dialog variable menu (inside the dialog editor), then assign them values once dialog has started:
IF
DialogStarted("LLAB_Dialog_Settings", _Instance)
AND
DialogGetInvolvedPlayer(_Instance, 1, (CHARACTERGUID)_Player)
AND
CharacterGetDisplayName(_Player, _Handle, _Ref)
THEN
DialogSetVariableStringForInstance(_Instance, "AutoBags_CharacterName_400b56ed-9303-4af7-a905-eedec3ff528b", _Ref);
You use the dialog variable GUID (much like root templates) to specify what variable to set. The dialog variables themselves have a few different value types. Notice I used the "set for instance" function version. I assumed this is just so it applies only to this specific dialog instance, and not all of them (so other players won't see this character's name by default). There's another version of the same method that just sets it in the dialog file as a whole.
To finally use the variable, you insert the dialog variable GUID into text inside the dialog node, enclosed in brackets:
Welcome [AutoBags_CharacterName_400b56ed-9303-4af7-a905-eedec3ff528b]!
Here's another example from an official script (RC_BI_ThePresence_Contract.txt):
IF
DialogStarted("RC_BI_DwarfDemonTrader",_DlgInst)
AND
DB_RC_BI_DwarfDemon_Bet(_Bet)
THEN
DialogSetVariableInt("RC_BI_DwarfDemonTrader","GEN_CheckPocketGold_SpeakerIndex_8504b4e0-886e-4912-9525-fbe559c5f8ff",2);
DialogSetVariableInt("RC_BI_DwarfDemonTrader","GEN_CheckMagicPocketGold_6057ad05-9492-4630-9f0a-be548b134c54",_Bet);