Ah yes, and i didnt reply to your comment about database entries, I think the best way would be to keep all NPCDialouge data in one table, and then each entry stores its parent id and any children IDs (hmm) (and maybe its root id for query optimization).
The key for that kind of setup is the fetching query that checks conditions, something i'm sure i will not get right the first try.
My "API" for my event scripts will likely stem from my main game script, which will provide a set of commands to do the stuff you mentioned.