Any reason the typical swarm statblocks won't narratively work in such a case?
If you want to homebrew something, maybe make a swarm of x goblins with very low AC, say 3-5, with similar HP. When a character hits, they hit multiple goblins per attack assuming they roll double the given AC. In most hits they'd be taking down at least two or three targets is what I'm envisioning.
Then the swarm reacts after each attack, using x number of the swarm per attack, with maybe three different tiers of attacks available, and each goblin can only go once per round.
As such, as the battle wears on they make fewer and less effective attacks.
But this all recreates what a swarm statblock is to some extent.