You don’t need to add it on a template, you can use the wp_add_inline_script() function. It’d be something like:
function tabs_enqueue() {
if(is_page( 205 )) {
wp_enqueue_script( 'ui', get_template_directory_uri() . '/js/ui/jquery-ui.min.js', [], '1.8', true);
wp_add_inline_script( 'ui',
'jQuery(window).load(function() {
//code here
});' );
}
}
add_action('wp_enqueue_scripts', 'tabs_enqueue');
Hope it helps!