Everything you create through the REST API (e.g. through PaperUI) gets saved to the JSONDB. You don’t have to do anything. It’s already there and it will be used. Furthermore, it gets automatically backed up for you as you make changes. See the /var/lib/openhab2/jsondb/backup folder. For example, all automatically discovered Things automatically get saved into the JSONDB.
You could do that but I don’t see a reason to. You can just write everything as text and not use the PaperUI JSONDB stored Rules at all. The link JimT provided should get you started with Jython. I also wrote a series when I moved my Rules from Rules DSL to Jython at: Journey to JSR223 Python 1 of 9. You will notice that I don’t use JSONDB stored Rules at all in that thread.
I do plan on moving them all to JSONDB but wont start on that until OH 3 matures a bit more. I’m hoping the new UI is more usable than PaperUI is.