WP Plugin: Print javascript in header

To only insert code into the header section in the admin area on single plugin pages you need to alter your add_action()function.

add_action('admin_head-pageof_thisplugin/thisplugin', 'thisplugin_adminhead');

function thisplugin_adminhead() {
    // here goes your content
    echo '<script>'
         .'/* ... */'
         .'</script>';
}

where pageof_thisplugin/thispluginis the hook slug that returns out of the function that creates your page like add_submenu_page(), add_options_pageoradd_management_page`.

Source and further details in the WordPress Codex