Is there a way to consolidate MIDI Remote Scripts and Surface Editor Scripts?

I used the Surface Editor to set up a good amount of pages that I’m happy with. This was attemptA.

Then, I mis-used scripting to create another 2 or 3 pages that I’m somewhat happy with. This was attemptB.

Is there an easy way to merge attempts A and B? I know I can recreate all of A in B by hand (using the Surface Editor), but is there an easy trick I can use?