Scripts and tags will not save or output from my custom meta box

Your using “esc_attr()” to escape the data, That is why it’s being converted to plan text. If you used echo it will likely work. However, your saving the script tags into the database.

I’m still on the learning journey just like you but here is what I would do.

TO SAVE THE DATA

//$my_data = sanitize_text_field( $_POST['global_notice'] );
//$my_data = $_POST['global_notice'];
$my_data = htmlspecialchars($_POST['global_notice']);

Then to output the data

if(!empty($global_notice)) {
    $myvar = htmlspecialchars_decode($global_notice);
    return $myvar;
}

If “return” does not work you could use “echo”.

Hope this helps.

Also, when creating shortcode you may want to learn about ob_start();
and return_ob_clean(); if your shortcode is being displayed on the front end in the incorrect position. You can always use the same code is a template file fyi.