Your updated script is working very well! I like the level up/down trick - haven’t thought of that.
I also learned that the binary part of an *.aeon file are attachment(s) to an event. The jellyfish above is actually from an entry in the “Feature Overview.aeon” example that comes with Aeon TL.
Reading the JSON of an Aeon file into an external DB is solved. But writing back to it looks like a hard problem. Every event has a hashed identifier of length 21 which will need to be added to a (new) event/entry. I haven’t figured which hashing algo is being used, and honestly, I don’t feel like spending time on this.
So plan B: I’ll customise a new, blank Aeon file and then see if I can get some mapping automation between the Export/Import working ok. An earlier import test produced several error messages because the data types were missing from the blank Aeon target file (instead of creating them).
If that doesn’t work (like you, I am struggeling a bit with the Aeon data structure), I’ll bite the bullet and go over to plan C and use the Open Source Timeline and its “wonderful” XML 
BTW, I saw that you have done some work with it and yWriter already. I just wish Aeon made integration a bit easier…