Ed beat me too it, but, yeah, Shaggy is largely a cartoon Maynard J. Krebs. A hungry, lazy offbeat teen. Most HB cartoons, of course, had an inspiration somewhere else in popular culture of the time and "The Many Loves of Dobie Gillis" was a big part of Scooby's. Fred is a much more boring Dobie, I guess, Daphne is beautiful Thalia and Velma is brainy Zelda although their romantic triangles from Dobie seem to be completely excised. Mark Evanier, who worked on some of the Scooby Shows, has confirmed this. Scooby is Hot Dog from The Archies, Scooby Doo started off with a musical angle that was a lot like the Archies.
Beats, especially the influential group around Allen Ginsberg, did in fact do lots of drugs including marijuana and Benzedrine (in addition to endorsing sexual liberation), but Beats in general weren't quite as closely identified with it as hippies became. Maybe because their movement was smaller and slightly less mainstream? Maybe because they were around when TV was squeakier and cleaner and it just kept them better hid from most Americans than TV did during the hippy era. Maynard, the Beat most people was familiar with, was a cartoony, TV friendly Beat. He was a popular character on a great show, but he wasn't really a good indicator of what was going on.
I think HB just wanted to have their cake and eat it too, here. Use elements with popular current feel while avoiding any negative elements associated with it. Hip but safe. I seriously doubt anyone in any position of authority there intentionally put drug references in the show or allowed them to slip through if they could catch them, although it might have been possible that writers might have put the occasional obscure ones in scripts that they didn't catch.
Here's the deal, I'm the best there is. I wake up in the morning and I urinate excellence. And nobody can hang with my stuff. I'm just a big hairy American winning machine.
I'm very humble, too.