I found the cause of the zombie dialog window. I was supposed to call
[parent endSheet] after calling [parent beginSheet]. Adding that stops
the window from reappearing. But it does not solve the whole problem.
Subsequent Command-S presses do not cause the file dialog to reappear.
In fact, they do not even generate a call to showOpenSavePanel, which
is supposed to present the dialog, and is also the function where all
of the changes have been made. So this would seem to be a different bug.
I see that if I open a new editor with Command-N and enter some text
then Command-S works for the new editor.