.d and .tp2 files are just plain old text (.txt) files. You just change the file extension. There's a tutorial section on this forum with very helpful tutorial on how to create NPC etc. You could also download Ghareth ; he's a fairly basic NPC and studying the files might help you understand how they work.
I really know to write a NPC Dialog. My doubt, in this case is so simple: The codes I use to write the NPC dialog, the form that I to compile them in the TP2 file, are the same codes that I write those dialogues that appears on the NPC heads in the "Cut Scenes" that appears during BGII-ToB. A good exemple of this, occurs in the Cut Scene when the the PCs leaves the "Irenicus Dungeon"; when "Imoen" is captured by the wizards. The dialog in this particular scene was entirely writed in "Display String", without the PCs interaction.
I'll take a look at the tutorial that you mentioned.
Thanks!