I also am very curious to know more about the complete solution.
It sounds like you've delegated if statements to configurable SQL queries, does that mean you need to take the context/variables/code and put it into a temporary SQL db whenever you evaluate them. Is the overhead of moving state into and out of SQLite a lot?
I really don't like continuous scrolling for retail shopping. its easier to remember what page something was on than a relative position. I don't mind it for pointless content consumption like Reddit and Facebook, because I rarely ever want to go back to something on those platforms.
https://news.ycombinator.com/item?id=30376623