You just edit the template, and put the usual <script...></script> tags, and save. If that corrupted your database, you’ve got bigger problems than anything MODx can do.
It should look like this:
<script src="manager/media/script/myscript/tips.js" type="text/javascript"></script>
For specific javascript for specific pages (forms and such) you can use
$source = 'assets/js/myscrip.js'; (or whatever your script's location and filename is)
$modx->regClientStartupScript($source);
in a snippet, call the snippet in the document’s content, and the line to include the script will be added to the template’s head for that page.