...snip...
Now if only I actually knew a little Python !!
So, for on chip non-volatile storage, there are 3 options. I'd like to help get at least one of these working.
#1: Use the remaining 186K of flash memory. This is a bit dangerous, but with some checks in the code, it ought to be able to avoid overwriting the 70K that's actually used. It also had a huge downside that the entire flash memory becomes unresponsive while writing. All interrupts must be disabled. The memory is writeable in 4 byte chunks and erasable in 2K blocks. Writing turns 1s into 0s, and erasing sets an entire block back to all 1s.
#2: Use the 2K EEPROM. This is the simplest way, but it's limited to only 2K. The code also already exists. Memory is writeable on 1, 2 or 4 byte sizes and can be rewritten easily.
#3: Use the 32K data flash. The 2K EEPROM actually is a hardware layer that writes to this 32K area, so it can't be used when EEPROM is configured. It works pretty much the same way as normal flash, writes are 32 bits and erasing is 1K blocks. The big upside to using the 32k data flash is it doesn't interfere with the normal flash memory (or risk overwriting micropython itself), so interrupts don't need to be disabled and normal can be run, as long it doesn't access the data flash memory.
EEPROM (#2) is probably the only option that can support interactive editing. Either type of flash probably needs to have the user compose their code in RAM, then "burn" it to the flash with a command. But what if they continue editing? Really, that's a rhetorical question.... my involvement will probably be limited to just writing up some example code that erases and writes. Let me know which of these schemes you'd like, and I'll try to assist on the C side. Who knows, maybe I'll even learn a tiny bit of Python somehow?!