You should read
Vectorboson's Dialog Tutorial. Although it doesn't actually show you how to use the two functions you're asking about, it'll show you how to create dialogs with buttons.
You can then change the action you've given a button with buttonSetAction or extract the script to be run when a button is clicked.
Example: Let's say you've defined a button in your description.ext with idc 100 (idc = the id number of the button control, can be any number) and you want to change the action it performs. You'd do this by calling:
buttonSetAction[100, "hint ""This is the new action - a hint!"""];
or you can make it call a script:
buttonSetAction[100, "player exec ""do_fancy_stuff.sqs"""];
If you'd later want to know what action is performed by the button, you can extract it by calling buttonAction:
the_action = buttonAction 100
If this is run after the last buttonSetAction, the_action would be the string:
player exec "do_fancy_stuff.sqs"
Hope this helps,
Pope Zog