You can't add script tags in questions or answers because it would be a huge security hole. Any user could add malware etc to your site. All HTML is sanitised to remove that.
If you want to add your own JS to certain pages, take a look at Admin > Layout and add it in one of the options there. Or use a custom theme.