You could use the scripts class but you can echo it like you are doing as long as you have "execute php" selected for the staticpage. One thing you have to do with any javascript code like this is to make sure you add a space before the } bracket and after the { bracket. This is to prevent Geeklog from seeing a template variable (which uses the same brackets) which is actually not there because it is javascript code. I updated your code for you with the spaces added:
Text Formatted Code
echo "<script type='text/javascript' src='https://www.google.com/jsapi'></script>";
echo "<script type='text/javascript'>";
echo "google.load('visualization', '1', { packages:['corechart'] });";
echo "google.setOnLoadCallback(drawChart);";
echo "function drawChart() { ";
echo "var data = google.visualization.arrayToDataTable([";
// grab the data from above
echo $result;
// end getting data
echo " ]);";
echo "var options = { ";
echo "title: 'My Graph',";
echo " };";
echo "var chart = new google.visualization.PieChart(document.getElementById('backlog_chart_div'));";
echo "chart.draw(data, options);";
echo " }";
echo "</script>";