with modern vehicles and german's especially on cars going all in on posh diagnostics on the end of an electrical socket (note these aren't posh) - almost everything on the road does at least this much. we often forget the basics
a compression test gives a really simple, low cost view of the mechanical state of the engine. Of course you are saying its seemingly intermittent, so mechanical things awry are less likely, bit not impossible
it will check for issues with the valve train not operating correctly, holes in pistons, destroyed rings, dodgy head gaskets etc. It should cranking a cold engine within 5 to 10 seconds hit (I guess) around 150psi on each cyl, (do one at a time all plugs out, throttle wide open), if its not something's wrong. If you get a big disparity >30PSI between pots that's not good, if one gets nothing or <90 PSI there is a big mechanical issue on that cylinder and you are going to need to understand and fix it.
Not saying this is your issue - but worth knowing and thinking about - a dropped valve means the thing has burnt out with continued use got worse and fell off or its just snapped off the end of the tulip valve due to stress (common on these at high miles). Most 4 stroke motocross bike's will snap off a valve in 1200 miles of use. It makes a horrible mess. You could have a slight bend and or a sticky valve that would get an intermittent issue. Likely I guess driven from a valve that's starting to fail
check this out (yes they are more highly tunes and with wilder cam opening but the idea is the same....) Note 50hrs use is about 1000 miles....
"Some motocross bikes can go a couple hundred hours with the valves still in spec, but that is very unlikely if you are racing. I suggest you replace the valves around 40-60 hours. Hard starting is a common indicator of at least a valve adjustment because they are tight and out-of spec."
I would be doing a compression test for piece of mind, and replacing the TPS they seem to last 30k miles each. And another common one could be a tired fuel pump and wandering fuel pressure