[...] So I believe the correct thing to do is to alter the window fill/spill trap handlers so that they store the current CPU state in the global area, and then add some code to OpenBIOS to allow this code to be accessed from C and Forth.
Something like that. Be aware that the fill/spill areas only get the i's/o's and l's, the g's have to be handled differently (there are three sets of globals, as I recall - default, alternate and interrupt).