You can try multiple ways:
Option 1 : Add new text area filed called in page properties and where content author can directly add the json LD script. You can also add check box to enable or disable structured data (optional)
something like as shown below.

- If the script is configured and enabled then load the script within <head> {propertes.jsonldscript} </head> something like this.
- Challenge: Content authors should have knowledge about script and make sure they are adding proper script.
Option 2: As @briankasingli mentioned, you can even try with Experience Fragments.
- Create a custom component - Author configure required content at dialog level & BE logic to generate JSON-LD script dynamically based on data configured by author & store the script at node level
- Create new path field at page properties level - author can browser script path/experience fragments path at page properties level.
- BE logic to read the script location & load the script with in <head> tag.
Hope this helps you.