Thanks for the suggestions. After I wrote this, things developed further. After working for several hours, the engine refused to shut off with the key switch. After parking the tractor in the shed, I shut it off with a shutoff valve on the aftermarket water separator fuel filter that I installed a few years ago. I am going to the dealer today to get a replacement fuel shutoff solenoid, as a search shows the non-stop problem is most likely related to the failure of that spendy little item.
A curious feature of the situation is that now, although I don't expect it to actually run with the fuel shut off, it won't crank, either. I hope that this is somehow caused by the failure of the solenoid, and not a coincidental something else. I do suspect that some of the random shutoffs before were caused by misalignment of the treadle when I got off the seat. I have greased it....Or maybe it was all caused by malicious gremlins.