That sounds like something that jQuery would excel at:
<script type='text/javascript' src='jquery-1.4-min.js'></script>
<script type="text/javascript">
$(document).ready(function() {
document.title = $('h2:first').text();
});
</script>
To modify the meta data, you would do more of the same. I strongly recommend jQuery - Novice to Ninja as an amazing way to get into great depth with jQuery.
<html>
<head>
<meta description="" />
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('meta:first').attr('description', $('h2:first').text());
alert($('meta:first').attr('description'));
});
</script>
</head>
<body>
<h2>Testing 123</h2>
</body>
</html>