You could use events to build up a system, to call dialogs depending on the variables the NPC is assigned with.
So maybe the NPC uses a variable called Dialogue with a value like 100 and another variable called DialogueEnd which ends with 105.
So in the end just call an hash table at 100, continue to loop till 105-100 times are over and so it displays only what is needed from a big hash table.
I saw a hash table plugin on the board somewhere.
This cuts down most dialogues into 1 or 2 simple events..