Tiddlywiki always "breaks" script tags rendered inside tiddlers displayed in the story-river and most translcusions as a security measure.
If you need the script included in the header portion of the HTML template used to render the whole page, tag the tiddler with "$:/tags/RawMarkup". This places the raw contents of the tiddler's text field in the header tag of the template. This requires that you Save and Reload your wiki.
If you use the other RawMarkupWikified tags (
$:/tags/RawMarkupWikified ,
$:/tags/RawMarkupWikified/TopBody, etc), then tiddlywiki tries to parse the text field of the tiddler so-tagged into "simple text" (stripping out HTML tags, etc). In order to prevent this, use a special "pragma line" at the top of the text field:
`\rules only filteredtranscludeinline transcludeinline`
This restricts text-processing to only transcluded data. Also, "Note that the wiki must be saved and reloaded in order for a raw markup tiddler to take effect. Also note that global macros are not available by default within raw markup tiddlers; you can use the
ImportVariablesWidget to explicitly import them."
I hope that helps.
Best,
Joshua Fontany