Ed will only preserve the "S" bit if the name remains EXACTLY the same.
For example, if you have the "s" protection bit on the startup sequence you have to use:
ed S:Startup-Sequence
and not
ed s:startup-sequence
The later will change the upper-case to lower-case and give the file the default "RWED" protection bits.