Weird brakes

Ok, then.
When that light comes on its telling you that there is a pressure imbalance between the front and the rear systems.this imbalance is usually thought of as being after the m/c., but it could be before as well.
since you say the m/c is full, im gonna assume there is no leakage.
since you say it stops halfway decent, ima gonna assume the front system is ok(it does like 80%plus of the work)
since you say the pedal gets hard, ima gonna assume theres no air in the system.
since you say its a random condition, its not likely just a simple rear brake adjustment.
since you say the lite can be turned off with a tap on the pedal;This is the tricky one.
I think pressure is remaining in one side of the system.. AFTER.. the brake pedal is released and the tap allows the fluid to return, and equalize the pressure to zero. Since it does this with the vehicle stopped, its not gonna be pad knock-back. And not likely a bad front hose. So Ima gonna guess its in the rear brakes, and its a combination of mis-adjusted star adjusters and a bad hose. Now it could just as easily be a sticking P-valve. Or a faulty M/C.
My detecting skills are done. Now its up to you to by process of elimination figure out the rest. I would start with a rear brake adjustment.(no cost and easy).
Gotta go to work, now.
Im back.
I can certainly see the m/c being faulty because of the random spongy pedal. If that is true ,it will turn the lite on when you jam the pedal on. However the lite should turn off immediately when you take your foot off the pedal, as the pressures normalize to zero Oh wait I get it ;the residual valve may be keeping enough pressure in the rear line to prevent the switch from self centering.In which case the spring inside the P-valve may be weak.
--So to summarize,looks like 2 problems; 1) defective M/C, and 2) weak return spring in P-valve. After the new M/C is on,the spring in the P-valve may go back to doing its job as there will be equal pressures on both sides of it. It may turn out to be a non-issue.