Yes, chat messages are stored in a table in the SQLite DB backing the repository you're chatting about, which allows you to close the browser window when you need some peace to concentrate on work, then revisit the chat room later and see what's been going on while you were away.
As for the dream of making SQLite faster or better, I doubt it. Fossil works best for small teams with projects sized reasonably for those teams, and chat privilege isn't generally given out to the masses. There's only one chat room per repo. Therefore, there simply isn't enough I/O involved to drive much in the way of SQLite changes.
Fossil proper has resulted in SQLite improvements, though, such as the recursive CTE feature added in 3.34.0. That directly supported a feature for tracing the history of files through renames across repository history using a single efficient (though complicated) SQL query: https://fossil-scm.org/forum/forumpost/5631123d66