This is what I ended up using, turned out I didn’t need to apply the meta value to the child pages since I used another approach.
Hopefully it’s useful for someone.
$row = $wpdb->get_row("SELECT * FROM wp_posts WHERE ID ='$post_id'");
$new_order = $order[$page['depth']];
$new_order = $wpdb->escape($new_order);
$current_order = $row->menu_order;
if($current_order != $new_order) {
switch ($new_order) {
case "1":
$color="pink";
break;
case "2":
$color="green";
break;
case "3":
$color="turquoise";
break;
case "4":
$color="brown";
break;
case "5":
$color="orange";
break;
case "6":
$color="pink";
break;
case "7":
$color="green";
break;
case "8":
$color="turquoise";
break;
case "9":
$color="brown";
break;
}
$color = $wpdb->escape($color);
$post_id = $wpdb->escape($post_id);
$wpdb->query("UPDATE wp_postmeta SET meta_value="$color" WHERE post_id = '$post_id' AND meta_key = 'color_dropdown'")
}