Although it's probably the first time such a team-up has happened in a murder mystery on TV, it wasn't the first time somebody came up with the idea.
On his own blog, William Rabkin relates his experience while working on 'Diagnosis Murder' with Dick Van Dyke':
"I supposed we were talking about teaming Dick up with another classic TV character, but we’d already brought back both 'Mannix' and Barbara Bain as Cinnamon Carter from 'Mission: Impossible'. It was beginning to feel like a well we’d been to an awful lot. Then someone had the idea — and I’m pretty sure it was me, because I’d been watching a lot of Dennis Potter at the time — that we should team Dick up with the greatest sleuth ever to grace a television set… Scooby Doo.
After a long bout of giggles, the story fell into place almost immediately. Dick’s character, Dr. Mark Sloan, would witness a crime, but before he could get away the criminal would attack and leave him in a coma. While the rest of the team searched for his attackers, Dick would be solving the crime in a series of hallucinations… with the help of Scooby Doo. There was one little problem, of course — we didn’t really have a lot of money in our budget for animated sequences. Fortunately, Lee can pull up TV trivia faster than Google, and he remembered that an animated version of Dick had “guest starred” in a Scooby Doo episode back in the 70s. All we’d have to do was get the rights to the footage, then write new dialogue, with our supporting cast doing the voices for Shaggy and the rest."
It would probably fall under the umbrella of unwritten fanfic, - and I know how Rabkin's fellow writer on that series feels about fanfic! - but why can't we just assume that Dr. Mark Sloan did have such an experience? It certainly doesn't cause a Zonk, as splained away in that previous article about 'Bones'/'Family Guy'.
It's a shame that the deal with Hanna-Barbera ultimately fell through because I think it could have been a TV classic. And H-B could certainly have ridden the publicity to bolster their dream to have a live action movie years earlier than it turned out.
My thanks to Mark Evanier for pointing the way to this story......