A muscle spasm was an uncontrollable reaction or movement of a muscle.
Muscle spasms while asleep could indicate that one was in a dream state. In 2370, Data observed that his sleeping cat Spot had experienced twelve muscle spasms. (TNG: "Phantasms")
The Jem'Hadar were afflicted with muscle spasms when they suffered ketracel-white withdrawal. (DS9: "The Abandoned")
While in close proximity to a type-4 quantum singularity in 2371, a number of crewmembers of the USS Voyager reported to sickbay with muscle spasms. (VOY: "Parallax")
Later that year, Miles O'Brien suffered muscle spasms after radiation poisoning decreased his serum calcium levels. (DS9: "Visionary")