File modification and permission warnings/errors can be avoided by saving into a new file. Then close out things, check that the old and new files are as they should be, and continue. Say, by deleting the old one and renaming the new file, or saving the new file as the original filename.
If /that/ doesn't work, you may have...limited options. Like, DXP core is crashing so hard that it can't even save anymore, and your last 10 minutes or whatever of work are toast.
Tim