Go into the Story Editor, then right click on the "Start" category on the left and "Add sub item" (or something like that) and type a name for the goal. Then go into the goal you made and put in the KB section something like:

Code
IF
DialogEnded("DialogName", _ID)
THEN
CharacterSetFollowCharacter(_NPCGUID,_PLAYERGUID);


Which would make the NPC follow the player once the dialog with the name "DialogName" (the dialog for an NPC you made and saved in the dialog editor) ended. Replace "_NPCGUID" and "_PLAYERGUID" with the CHARACTERGUID of the NPC and player. Can get these by right clicking on the character in the editor and then "Copy TypeGUID" (or something like that) then copying and pasting it. Or you can start typing the Name of the NPC/Player in the script then hitting control+space bar, then you can select them from the drop down. Make sure you do File > Generate Definitions first.

Once it's all done do File > Generate Definitions, Build and Reload. Then you can test it.