You might want to try out Power Query (get & transform).
Step-by-step repeatable transformations where the UI records steps and writes code in the background.
Almost exactly what you're talking about, and comes out-of-the-box in the last few versions.