I get this pretty bad from time to time. Usually, I'm spelling a word over and over again. Sometimes, the chorus of a song.
When I consciously recognize I'm doing it, I can usually force myself to switch from one word to another, and after three or four times, I lose interest in it.
Worst is waking up in the middle of the night doing it. I try to avoid it by keeping video playing overnight.
The regulation you cited does not strictly prohibit the mailing of "perishable items".