A valuable feature in the editor would be to display a marker in the editing window where javascript is found.
This could be similar to the flag that displays where an anchor tag is found.
The purpose of the marker would be to tell client users not to attempt to edit within that area of the page. I guess that the area could be locked, although a visual indicator could also be useful.