refactor 22 arms match in script_task.rs fn handle_msgs