They raise the pH and act as the accelerator for the developer.
Yup, as also recently discussed here:
https://www.photrio.com/forum/threads/msa-o-n-january-2024-decks.203932/page-2#post-2764171
@Don_ih has been experimenting with acetone/sulfite as the activator in developer, cf. Bishop's developer.
For lith developers specifically there's a thread here that's worthwhile having a look at:
https://www.photrio.com/forum/threads/lith-developer-formulation-question.102948/
In my experiments with lith developers, I never found to be much magic in the actual developer, as long as it's (very) low in sulfite and only uses hydroquinone as the developing agent. I ended up mostly using a spin on Ryuji Suzuki's lith developer because it was super simple, cheap to make and very effective. Regardless of the developer used, what matters most is the combination of exposure and development, with massive exposure and very, very slight development giving the most dramatic (contrast, color/hue) results.
Paper of course plays a major part, too. Lots about this to be found online.
What did matter (a lot) was the amount and type of restrainer; large quantities of chloride gave pretty pink hues while bromide tends more towards yellow, at least on Fomatone paper. Another 'trick' that has a lot of impact is to use a 2-bath development approach with one bath being a developer consisting only of metol with very little or no activator and maybe only a bit of sulfite (I'd have to go back and check my notes). This will bring out a very light, low-contrast, colorful 'base' image on top of which you can develop a lith/infectious image.
Toning of course makes a dramatic difference; it's very powerful.
There's a couple more tricks along these routes; most of what I experimented with, I gleaned from Moersch' range of lith developers and adjuvants. By rooting in the documentation and SDS of those products, I was able to reconstruct a couple of interesting things.
My suggestion would be to look into these directions and not waste too much time on the formaldehyde/acetone thing. It's mostly just a very roundabout way to do something that's more easily done with more regular chemistry. I.e. hydroquinone, a tiny pinch of sulfite (<2g/l), some bromide or chloride (potassium or sodium; the ammonium salts tend to fog) and some (sodium or potassium) hydroxide or carbonate as an activator.