Creating custom setting in add media popup

Got some assistance from another forum. It spurred some brainstorming at the office and we came up with a solution. Not sure if this is the best way to resolve it but it is working as expected. I added this code:

delete_post_meta($id, 'add_class', true);

just above the:

return $html;

at the end of the last function and everything is behaving properly. If there is a better solution, please let me know.