Symbolism, Imagery, Allegory
Most of us don't fancy a wasp. They are pretty unloved as creatures go. As we see in the novel, they can sting over and over again without dying, unlike bees who can only sting once. When Jack gives Danny the wasps' nest he bug-bombed on the roof, we're pretty sure there's trouble on the horizon. Of course, the dead wasps come back to life, and come back to their nest, only to sting Danny in his sleep and put Jack back in the perennial doghouse.
Like the hedge animals, we can see their roots of the wasps in King's own childhood. In his On Writing: A Memoir of the Craft, King reveals a moment from his life at the age of two. He was "imagining" he was the "Ringling Brothers Circus Strongboy" complete with "animal skin singlet." To demonstrate his strength, he lifted a cinderblock that happened to have a wasps' nest inside it. He was stung by a wasp hidden in the cinderblock, causing him to drop the block on his tender tootsies.
Similarly Jack is stung by the wasps on the roof when he's being creative, sorting through the issues of his play in progress. We say similarly, because in both cases the wasp stings seem like punishment for being creative. In the equipment shed, Jack sees the black and yellow snowmobile as a wasp. He thinks of it as another stinging pest that will take him away from his imagination, his desire to create fictional worlds. As always, the Overlook perverts reality. The snowmobile, wasp-like as it is, could have helped Jack live to practice his craft.