It turns out that “muggle” is a Middle English word for “mullet tail, or person with a fish tail,” and it seems to have been used both ways. There was also “mugling,” which was a descendant of such a tailed person.
It’s in freakin’ Layamon’s Brut, for goodness’ sake.
Other spellings included “moggles.” The tail itself is also spelled “mughel.” Other spellings of the fish name include “mugil” (that’s the mullet fish), and “migal/migale” (also the mullet fish).
The Fordun Scotichronicon tells the story of the town of Muglington as being a place where everyone was born with tails, and that therefore people in Kent were called Longtails. It was the result of a visit by St. Augustine of Canterbury, when the pagan Saxon people refused to listen to his preaching. Even worse, they twisted what he said, and then mocked him by sewing fish tails onto his clothing. So God cursed them and their posterity with a tail on their posteriors.
The author says that the village of Thanewyth in Mercia also supposedly mocked St. Augustine and got the same punishment. And that St. Thomas a Becket got mocked in the Middle Ages by having his horse’s tail docked, but then the people of that town got tail-cursed also.
There is a fun little article about this which enumerates all the mocking and repeating and references to these stories that people from Kent got, in an 1896 issue of the Transactions of the Glasgow Archaeological Society.
Obviously this was not in Rowling’s mind, but it probably was part of why the name was so insulting, in her universe. Non-wizards are not just mudbloods; they are beasts, not even warmbloods, cursed with fishes’ tails.
Anyway, here’s a few more uses of the word “muggle” before Rowling.