stripslashes() on the output.
Another approach would be to have a specific field for each script that you'd like to output. Have the user enter their ID/identifier/or whatever piece of unique information is required for a particular snippet. Then in your output function, concatenate and escape (using
esc_js()) the user entered value into the boilerplate JS snippet. This is pretty rigid, but it would give you tight control over what the user is able to add to the site.