Calling a script from a dialog is very easy:
You can use either a gff editor or dlg edit.
DLG edit:
If you open the dlg file with DLG edit you'll see a menu that contains EntryList and ReplyList ( I think Entry is no. 5 and reply is no. 6 ). The entry list is what the npc says and the reply list is for the pc. Open one of the two, select the dialog branch you want to attach the script to and press enter. Then select the field called "script" and type the name of your script. Press enter: the script name should now appear beside the field called script. Save your file and test.
Screenshot:
http://img47.photobucket.com/albums/v144/Darth333/?action=view¤t=dlgedit.jpg)
GFF editor:
Same thing: you'll see and EntryList and a ReplyList. However, unless you typed custom entries and replies, you wont be able to see the text that is spoken. You can view the .dlg file (but not edit) with KT. Just press ctrl and double click.
Select the dilaog branch you want to attach the script too and type the name of the script you want to attach to the dialog.
Screenshot GFF editor (the screenshot was taken using the custom made GFFeditor) :
http://img47.photobucket.com/albums/v144/Darth333/?action=view¤t=gff_script.jpg)
With Bioware GFF Editor:
http://img47.photobucket.com/albums/v144/Darth333/?action=view¤t=gff_script1.jpg)
(links for GFF editor and DLGedit provided in my sticky): Guide for the newbie: how to install mods. /What tools do I need to start modding? (
http://www.lucasforums.com/showthread.php?s=&threadid=129789)
Hope this helps :)