Here's my version of your script Uriah.
As you can see, the overall length have been considerably reduced.
This is the script used on the F-117 to display the heading digits on the left screen, but now you don't need to call the meshes within the initialize function anymore, making the script even shorter.
var geom, jsb;
function rad2deg(angle_rad){return angle_rad*180/PI;}
function digits(input, lenght_string, lenght){
var string = (Math.round(input*1)/1).toString();
this.str_length = string.length;
this.value = (lenght_string + string).slice(lenght);
}
function update_frame(dt){
//Digits Heading
var digits_hdg = new digits(rad2deg(jsb['attitude/heading-true-rad']), "000", -3);
geom.set_mesh_visible('MFD9_hdg_A_00', digits_hdg.value.charAt(0) == 0);
geom.set_mesh_visible('MFD9_hdg_A_01', digits_hdg.value.charAt(0) == 1);
geom.set_mesh_visible('MFD9_hdg_A_02', digits_hdg.value.charAt(0) == 2);
geom.set_mesh_visible('MFD9_hdg_A_03', digits_hdg.value.charAt(0) == 3);
geom.set_mesh_visible('MFD9_hdg_A_04', digits_hdg.value.charAt(0) == 4);
geom.set_mesh_visible('MFD9_hdg_A_05', digits_hdg.value.charAt(0) == 5);
geom.set_mesh_visible('MFD9_hdg_A_06', digits_hdg.value.charAt(0) == 6);
geom.set_mesh_visible('MFD9_hdg_A_07', digits_hdg.value.charAt(0) == 7);
geom.set_mesh_visible('MFD9_hdg_A_08', digits_hdg.value.charAt(0) == 8);
geom.set_mesh_visible('MFD9_hdg_A_09', digits_hdg.value.charAt(0) == 9);
geom.set_mesh_visible('MFD9_hdg_B_00', digits_hdg.value.charAt(1) == 0);
geom.set_mesh_visible('MFD9_hdg_B_01', digits_hdg.value.charAt(1) == 1);
geom.set_mesh_visible('MFD9_hdg_B_02', digits_hdg.value.charAt(1) == 2);
geom.set_mesh_visible('MFD9_hdg_B_03', digits_hdg.value.charAt(1) == 3);
geom.set_mesh_visible('MFD9_hdg_B_04', digits_hdg.value.charAt(1) == 4);
geom.set_mesh_visible('MFD9_hdg_B_05', digits_hdg.value.charAt(1) == 5);
geom.set_mesh_visible('MFD9_hdg_B_06', digits_hdg.value.charAt(1) == 6);
geom.set_mesh_visible('MFD9_hdg_B_07', digits_hdg.value.charAt(1) == 7);
geom.set_mesh_visible('MFD9_hdg_B_08', digits_hdg.value.charAt(1) == 8);
geom.set_mesh_visible('MFD9_hdg_B_09', digits_hdg.value.charAt(1) == 9);
geom.set_mesh_visible('MFD9_hdg_C_00', digits_hdg.value.charAt(2) == 0);
geom.set_mesh_visible('MFD9_hdg_C_01', digits_hdg.value.charAt(2) == 1);
geom.set_mesh_visible('MFD9_hdg_C_02', digits_hdg.value.charAt(2) == 2);
geom.set_mesh_visible('MFD9_hdg_C_03', digits_hdg.value.charAt(2) == 3);
geom.set_mesh_visible('MFD9_hdg_C_04', digits_hdg.value.charAt(2) == 4);
geom.set_mesh_visible('MFD9_hdg_C_05', digits_hdg.value.charAt(2) == 5);
geom.set_mesh_visible('MFD9_hdg_C_06', digits_hdg.value.charAt(2) == 6);
geom.set_mesh_visible('MFD9_hdg_C_07', digits_hdg.value.charAt(2) == 7);
geom.set_mesh_visible('MFD9_hdg_C_08', digits_hdg.value.charAt(2) == 8);
geom.set_mesh_visible('MFD9_hdg_C_09', digits_hdg.value.charAt(2) == 9);
if (digits_hdg.str_length <= 2)geom.set_mesh_visible('MFD9_hdg_A_00', false);
if (digits_hdg.str_length <= 1)geom.set_mesh_visible('MFD9_hdg_B_00', false);
}