It’s stripped out by default as adding script in an RTE is a security concern. Are you able to add your structured JSON using another means rather than relying on adding via an RTE (I don’t know your use case?).
The only solution is to amend the ValidElements as you already have done to ensure it doesn’t get stripped out by TinyMCE. I would suggest you would be better off putting your structured JSON in a separate property as the RTE is not really the best place for it.
The issue with your ValidElements config is the … at the start that’s not valid syntax and won’t preserve the existing default elements. You need to copy the entire default ValidElements string from the Umbraco v13 RTE config docs and append ,script[*] at the very end. Also make sure to restart the app after any appsettings.json change, as settings are only loaded on startup.
That said, Justin’s suggestion of a Textarea property is still the cleaner long-term solution for JSON-LD.