It seems I'm another potential casualty of this phenomenon and after googling my symptoms stumbled across this topic, which has been going on for years!
Having read through my symptoms and those of others on the first first couple of pages and most recent (I didn't read all 11 pages). It reminded me of a condition common in motorbike racers called "Arm pump" (but in the legs), so just thought I'd introduce my theory.
Turns out the real name of the condition is Chronic exertional compartment syndrome, I'd recommend the Wiki article, but a few selected quotes...
When compartment syndrome is caused by repetitive use of the muscles, as in a cyclist, it is known as chronic compartment syndrome (CCS)
The cause of compartment syndrome is due to excess pressure on or within the muscle compartments. This pressure can occur for many different reasons, many are due to injuries. Injuries cause the swelling of tissue. The swelling of the tissue forces pressure upon the muscle compartments, which has a limited volume.
Muscle size may increase by up to 20% during exercise. When this happens, pressure builds up in the tissues and muscles causing tissue ischemia (lack of Oxygen to the muscle).
Symptoms involve numbness or a tingling sensation in the area most affected. Other signs and symptoms include pain described as aching, tightening, cramping, sharp, or stabbing. This pain can occur for months, and in some cases over a period of years, and may be relieved by rest.
If you consider that heavy training would cause many tears and damage to your leg muscles and prolonged periods of blood flow to the legs increasing muscle size, it's certainly a possibility that the spasms are driven by the pressure that has built up within the muscle. This is then temporarily relieved when cycling again therefore you're actually covering up an underlying issue which probably needs a prolonged time off the bike to heal?
I'm pretty sure the long term answer is more time off the bike rather than jumping back on it...