That’s interesting. With TW 5.2.x you should be able to directly read and write to the TW internal store, because it is JSON format now.
The store is covered by an HTML SCRIPT tag that contains an array of JSON tiddler objects
<script class="tiddlywiki-tiddler-store" type="application/json">[
{"title":"tid1" ....}
{"title":"tid2" ....}
{"title":"$:/core" ....}
{"title":"$:/plugin/..." ....}
]
</script><div id="storeArea" style="display:none;"></div>
The new store is right “above” the “old” <div id="storeArea", which should be empty.
There can be several <script class="tiddlywiki-tiddler-store" type="application/json"> elements/stores. So if you are sure you only add new tiddlers it should be simple to extend the tiddler store.
The only thing you need to do, is to escape < to < in every “value” string. Then you should be good to directly modify the tiddler store.