You should do something like this:
var allOptions = options ? options : {};
allOptions.close = function () {
{do something}
};
jQuery('{selector}').dialog(allOptions);
There is no need to overriding buttons. Add event handler for close.
Also if you not doing anything in that function there is no need to add it at all. Dialog should do fine by it self.
See
http://jqueryui.com/dialog/#modal[
^]