When trying to add inline Java Script to a Generic Content control the script tags are HTML encoded / removed.
This is the default behaviour so we must enable script tags.
To do this you must edit the control template for Generic Content.
Open the following file in Visual Studio:
Sitefinity --> Admin --> ControlTemplates --> Generic_Content --> App_LocalResources --> ContentVersionView.aspx.resx
Add a new setting: ContentFilters = None
There are still some problems with this. E.g. If you use a noscript tag then the contents of that tag will still get HTML encoded.