When using google.script.run, you pass variables directly. So you can simply call browser() with the ID of the folder you want.
In the script file:
function browse(folderID)
{
var use_root_folder = typeof(folderID) == "undefined";
var base_folder;
if(use_root_folder)
{
base_folder = DriveApp.getRootFolder();
}
else
{
base_folder = DriveApp.getFolderById(folderID);
}
//more code...
}
And in the HTML file:
<script>
google.script.run.browse(selectedFolderId);
</script>