This should do the trick. Simply add it to your functions document. the \n is a line break to make your code look nicer when it spits it out.
add_action('wp_enqueue_scripts', 'customJsFunction');
function customJsFunction(){
global $post;
$script= get_field('header_script',$post->ID);
if($script){
echo '<script>'."\n".$script."\n".'</script>'."\n";
}
}