So in the spirit of OGR being a discussion forum for the exchange of ideas...hare-brained or otherwise...
I'd be astonished if what the OP is looking for exists plug-and-play for the O-gauge market. The idea of "random" time intervals to run the engine and stop the engine is easy enough to understand...but how to get it done is another matter!
What about a recordable sound module? Now hear me out!
Everyone's seen/heard those talking greeting cards or sound modules where you can record your own voice or sounds. They are typically specified in length of recording time. It used to be only seconds of audio... but now the recording times are measured in minutes, hours, or even days for not much money.
Above is a 4 minute audio recorder/playback module. Battery powered (i.e., DC power). The idea is to make a 4 minute recording with the idea that when there's audio (your dog barking, your toilet flushing, or whatever) this activates a relay that applies track power to the engine. When there's NO audio (silence), the relay turns off track power. So, say, 30 seconds of sound, 20 seconds no sound, 40 seconds sound, 26 seconds no sound, 24 seconds of sound, 33 seconds no sound, etc. until you have a 4 minute recording. Most of these modules support continuous or repeat-play so the recording simply repeats over and over.
Then, rather than hooking up the speaker, you hook it up to a relay that turns on whenever there's "voltage" at the speaker wires. You can get very inexpensive ($2-3) DC-powered relay modules that can be triggered by low-level voltages.
OK, it's not exactly random since there's a pattern. But I'll bet you can't tell. And you can get recordable sound modules that can support hours-long recordings.