Extended rich text editor module has a feature that allows to use javascripts or other special code that by default is not available in the plugin. To apply this kind of feature module adds an override of validate class in prestashop. If you can't save the javascript (and see the message that contents are not valid while you try to save them) - this means that override is not active.
Overriding is a way to "override" class files and controller files. PrestaShop's ingenious class auto-loading function makes the "switch" to other files fairly simple. PrestaShop allows to disable overrides, or these overrides are disabled automatically in some cases (like update of the shop) or while you apply security patch (presta from time to time releases security patches). If overrides will not be enabled - rich text editor will not save javascripts! To enable overrides in shop please follow this guide: disable / enable overrides in prestashop