MPScripts has a snippet of code that might help you out a bit more
http://mpscripts.net/code.php?id=1
code:
var BrowseInfo = Interop.Allocate(32);
BrowseInfo.WriteDWORD(0, 0); //hOwner
BrowseInfo.WriteDWORD(4, 0); //pidlRoot
var foldertitle = Interop.Allocate((255+1) * 2);
BrowseInfo.WriteDWORD(8, foldertitle.DataPtr);
var sTitle = 'Test Window Title';
var pTitle = Interop.Allocate((sTitle.length+1) * 2);
pTitle.WriteString(0, sTitle, false);
BrowseInfo.WriteDWORD(12, pTitle.DataPtr);
BrowseInfo.WriteDWORD(16, 1); //ulFlags
BrowseInfo.WriteDWORD(20, 0); //lpfn
BrowseInfo.WriteDWORD(24, 0); //lparam
BrowseInfo.WriteDWORD(28, 0); //iImage
var pidl = Interop.Call('shell32', 'SHBrowseForFolder', BrowseInfo);
var folderpath = Interop.Allocate((255+1) * 2);
Interop.Call('shell32', 'SHGetPathFromIDList', pidl, folderpath);
Debug.Trace('Folder Path: ' + folderpath.ReadString(0, false));
Debug.Trace('Folder Title: ' + foldertitle.ReadString(0, false));