It seems that this solution, which was working in 2.3.3, no longer works in 2.3.4. The 'valid_elements' and 'extended_valid_elements' are no longer set in LeftAndMain.php but in cms/_config.php, via HtmlEditorConfig::get('cms')->setOptions. But now using the wildcard approach to allow all tags, as mentioned above, doesn't work - the content of the Javascript tags is still being stripped. I presume something else now needs to be done instead (or as well). Any suggestions?
As to the security risk of allowing Javascript, which Hamish cautioned about, surely it depends on who is going to be doing the editing. If one is not opening up the CMS editing capabilities to the general public but to a trusted group of 3 or 4 known content editors, one should be able to allow such things. This is causing me quite a lot of problems at the moment. I'm converting over a simple site I did prior to working with Silverstripe, and one page which features embedded Javascript tags for an availability calendar script has taken me much longer so far than the whole of the rest of the site.