This sounds like a program that should be written in a simple language - like lua. Unfortunately you will probably have to write it yourself.
An alternative is to make a pdf, html or txt file and use bookr (a homebrew ebook reader included in the latest irshell (i think)) to read them.
Bookmarks