Hm. ODF is officially okay with foreign elements (under certain restrictions, e.g. not using certain namespaces). Just ripping out any nonodf-elements with localname "script" or "style" might break custom enrichments and go against the "keeps all unknown content".claim WebODF features.
Someone even could use custom extension using html javascript, why not.

Could elements perhaps be renamed instead, as in: on loading create subsitute nodes for the dangerous one, coping all childs and attributes over, and on saving have the serializer know about the substitutes and writing original names back?