Regarding the “desired state of pitch”:
Just for fun, I temporarily changed (on my PC only) the target pitch angle in the simulation to 1 degree - the effect was that the rider very frequently crashed when starting, but if they didn’t, they were condemned to keep accelerating until the legs were a blur (in a constant fight against gravity). That doesn’t really prove anything of course.
In real life, there is wind resistance which requires a slight forward pitch to balance, and also rolling resistance has an effect - especially, say, if ploughing along sandy/muddy ground, significant torque is needed just to move at a constant speed, and this will require an average extra forward pitch. A hill climb also means constant torque application is needed and to stop this also tipping the unicycle backward, gravity has to be enlisted, meaning a slight forward pitch of the center of mass is needed.
So the rule is that if you need to put torque into the axle it has the primary desired effect at the wheel, but also an effect on the pitch of the system which has to be countered by gravitational force which needs an offset center of mass to take effect. The exact amount of compensatory pitch (and how to get it) is a bit tricky, but oddly enough we humans manage somehow to do it without even thinking!
Regarding the “pitch oscillation”:
This is just an artifact of our human physical inadequacy and our weird pedal cranks which means that even if we just want to cruise at a constant speed (with a small constant torque to overcome resistance), we cannot do it like an electric motor, we sway back and forth in time with the crank angle, but it doesn’t matter much, as long as balance is achieved on average.
Regarding computing optimal inputs for training a human:
I don’t think the code in my rider simulation would help. The code “rides” in a different way to a human and is an imperfect simulation. Humans are a crazy floppy bag of gooey stuff and bones, with a brain which constantly constructs short term riding targets (partly unconsciously) using recent and historical observations, and each human has different measurements, and setting up and strapping sensors would be expensive and difficult, and I reckon humans need to learn by observing the actual riding feelings (force, speed, position, body balance state) using their own real senses rather than observing a possibly faulty (and distracting?) artificial sensor. But having said that, I agree it would be great if there was some way that a “trainer” could be set up so learners would not be overly distracted by fear of injury and could learn aspects of riding in stages, but I think it may be a HARD problem. But @unibabyguy , I hope you persist with it, and good luck!