Where are custom widget templates stored?
can you please let us know which Sitefinity version you're using - is it the one associated with this post (4.2.1733) or 4.2.1650? The reason I'm asking is that in 4.2.1650 which was our official release of Sitefinity 4.2 due to security reasons we decided to strip all script tags from the default Sitefinity templates. After some client feedback we changed this and currently 4.2.1733 only server side code is being stripped. However, if you have experienced some issues on our latest officially supported release, please let us know in detail the steps you have taken to reproduce this issue, so we can advice you better. Another approach to customizing your widget templates might be to use the ViewMap and amp an external template to your controls. For more information on mapping external templates to Sitefinity 4.x widgets, please check these resources:
Customizing Sitefinity 4 Controls with the ViewMap
Mapping External Templates for Sitefinity 4 Widgets
the Telerik team