Custom Script Section Only Echoes Text

This is probably not the best answer, someone may know a way for this input to be properly handled given that you want to store code in it, but this will probably do what you’re intending:

<?php echo html_entity_decode(get_theme_mod( 'footer_code')); ?>

Note this is probably somewhat of a security risk, and this behaviour of WordPress escaping the HTML characters prevents exactly what you’re trying to do for security reasons. You may want to see if there are other ways to do what you’re trying to do here that don’t allow that to happen.