The answer to ConTeXt: avoid enumeration items across pages was a nice introduction to modifying TeX before rendering, like HTML with JavaScript.
\startsetups [userdata:itemize]
\setbox\scratchbox\vbox {
\blank[disable]
\startitem
\getinlineuserdata
\stopitem
}
\ifdim\ht\scratchbox>\textheight
\page\unvbox\scratchbox
\else
\box\scratchbox
\fi
\stopsetups
Is more advanced reflection possible? For example, is it possible to iterate over the contents of \getinlineuserdata? Is it possible to iterate with an index? Is it possible to iterate only over matching items - blocks or environments or groups or whatever the answer to the question ConTeXt: Block vs Environment vs Group is?