Look, I can help but I can't write all the code. You have a lot of questions and expect people to write all the code for you. There's a job section for that. I work on a lot of paid projects and I don't have time, can't and don't want to do everything in cases like this...
Anyways, make an array of colors and use foreach to replace each one of them, or look if there is a SQL query to replace more stuff, I have no idea. Not sure how fast is this, but it probaby can be optimized...
<?php
function wm_item_post_replace_meta_value($item) {
$field_id = 5; // CUSTOM FIELD ID
$item_id = $item['pk_i_id']; // Get item ID.
$dao = new DAO(); // Intialise data access object.
$colors = array('red', 'blue'); // List of colors.
foreach($colors as $color) {
$query = sprintf('UPDATE %st_item_meta SET s_value = "%s-color" WHERE fk_i_item_id = %s AND fk_i_field_id = %s AND s_value = "%s"', DB_TABLE_PREFIX, $color, $item_id, $field_id, $color); // Update.
$dao->dao->query($query);
}
}
osc_add_hook('posted_item', 'wm_item_post_replace_meta_value');
Regards.