This is interesting, but to be honest it’s more learning than I personally want to take on for this use case.
One feature that I miss from code editors is “record actions”. The last time I remember having it was maybe in visual studio around the late 90s. It would record whatever you did (keystrokes/copy paste/find replace/etc). At that time, I found that I could often address use cases similar to those I think you are targeting by thoughtfully recording the right sequence of actions.