Correct. I don't know that much about it myself, but each dialog has its own ID. So if you want to reference an instance ID, you need to create a variable to do so. Look at the script I provided above. The DialogGetLocalEvent requires the DialogInstanceID from the DialogEnded, which I have used a variable "_smithdiag" for:
IF
DialogEnded("blacksmith2",_smithdiag)
AND
DialogGetLocalEvent(_smithdiag,"blacksmithFlag", 1)
THEN
CharacterMoveToTrigger(CHARACTER_Town_Blacksmith,TRIGGER_BlackSmithPointTrigger,0,"smithWalkBack");
Now, if I change it to:
IF
DialogEnded("blacksmith2",_smithdiag)
AND
DialogGetLocalEvent(0,"blacksmithFlag", 1)
THEN
CharacterMoveToTrigger(CHARACTER_Town_Blacksmith,TRIGGER_BlackSmithPointTrigger,0,"smithWalkBack");
then the THEN statement won't fire because DialogGetLocalEvent is not being directed to the same DialogID from the IF statement above it. So you need to have the correct DialogID to point to the correct dialog, if I'm understanding it correctly.