Hi!
Thanks for your input!
I just found the cause.
There is an os.kill call on the C4DPL_ENDPROGRAM message. If you leave it out some python stuff seems to keep running and preventing Cinema from being opened again. I am assuming that's why the original author did that.
I will just catch the dirty flag myself and deal with unsaved scenes before terminating the process. Unless you know a more elegant way.
I will mark this as solved.
Thanks again.
P.S.: This is off topic, but trying to reply I would always get an error and I had to log out and in again to post this.
EDIT: I found the elegant solution - Adding c4d.documents.CloseAllDocuments() before the process termination handles the save dialogs perfectly!