I have been searching really hard since you posted your question.
Wordpress implementation of online code editor is cool but sometimes very annoying because it is a basic plain text editor.
A theme Editor will be very good. How to implement such feature?
Using your procedures
- Copy existing theme folder with another name
- Change theme name ("name": "Base") attributes in metadata.json
- Change other codes in the above editor eg. Ace editor.
I choose ace editor because of ease of use and its lightweight. Easy to implement.
we need an open source code editor that is extremely light .
Crud features too are indispensable. It is very good to have such a feature.
There is an online editor http://online-php.com/source/. This editor is interesting because it replicates the process of editing files via ftp.
I believe we can strip or modify the editor and remove functions that we do not not need.
I am still researching for editors and trying to see exactly how wordpress implements it.
If I get anything, I will update the answer.