I wouldn't try to temporarily enable a deprecated feature. According to the MDN documentation for showModalDialog, there's already a polyfill available on Github.
I just used that to add windows.showModalDialog
to a legacy enterprise application as a userscript, but you can obviously also add it in the head of the HTML if you have access to the source.