It's a nice idea to use the "string map"-command, but, sorry, I think it's not the solution for the original problem.
The purpose is, to find a pattern "blue" an then to replace another string "aaaa" (not the pattern) at the same line with a subsitution value...