You are considering an editor-based approach.
You could also consider a compiler based approach. You could extend GCC using your MELT extension which would add a pass. This pass would just have to add some extra Gimple into the GCC internal representations.