Have a look at
matty's reply to Browse For File.
You'll probably need to modify some things, as I don't think you want the dialog to open at script start-up for example, but I think you'll be able to figure that out. Also, because that code was written for an Open File dialog, you'll have to make some modifications to get a Save File dialog, for example you'll have to call GetSaveFileName instead of GetOpenFileName. You'll also have to change the flags in the structure, as some flags only work with Open File dialogs and others are interesting to use for a Save File dialog.
Experiment with it. It's the only way to actually learn how to do it.