I´d put a Template Variable in the head-section of my template to keep parts of it dynamic.
Then, you can put some CSS, JS or whatever you like in that TV, depending on your needs on a specific document.
<html>
<head>
<title>[*pagetitle*]</title>
<meta>...</meta>
[*sampleTV*]
</head>
<body>
[*content*]
</body>
</html>
Content of [*sampleTV*] might be then:
<script type="text/javascript" src="[(baseurl)]assets/templates/your_template_here/your_jsdir_here/sample.js"></script>
<script type="text/javascript">
alert("Sample!");
</script>