The fun began with bad neighbors. It was the mid-1980s and prolific horror novelist Michael McDowell was trying to break into the movie business. In the wake of blockbusters Poltergeist and Ghostbusters, he hoped to write his own supernatural script.

One day, at their home in Medford, Massachusetts, the author and his partner, award-winning Tufts professor Laurence Senelick, were thinking of ideas. Back then, the families living nearby often annoyed them. Senelick can’t recall what they did exactly, but it served as inspiration.

Spooky films usually featured evil spirits preying on unsuspecting humans. Senelick wanted to flip that premise. “What would be the situation if you had good ghosts,” he remembered asking McDowell, “and it’s the people who moved into the house who were awful?” With that concept in mind, McDowell devised a professional bio-exorcist to scare off the insufferable occupants.The brainstorming session formed the basic plot of one of the decade’s funniest, scariest movies. Released 30 years ago this week, Beetlejuice was the kind of comedy that could only have been thought up by someone possessing a nightmarish sense of humor. “My philosophy, if I have one,” McDowell told Fangoria in 1984, “is that the universe is a joke and we are the butt of that joke.”

No other material was or ever will be better suited for the then-29-year-old Tim Burton’s playfully macabre aesthetic. The director’s second full-length feature tells the story of a deceased couple Barbara and Adam Maitland (Geena Davis and Alec Baldwin) whose old Victorian home is invaded by tasteless yuppies Delia and Charles Deetz (Catherine O’Hara and Jeffrey Jones) and their goth teenage daughter Lydia (Winona Ryder). Michael Keaton plays the iconic title character (spelled Betelgeuse, like the star) with the perfect amount of grimy, charming sleaze. In The New Yorker, critic Pauline Kael compared the actor’s performance to “an exploding head” and wrote that “he isn’t onscreen nearly enough.” Burton’s Danny Elfman-scored opus is stuffed full of campy, terrifying special effects, teen angst, nouveau riche bashing, New England charm, a vision of death as an inescapably dysfunctional bureaucracy, and Harry Belafonte songs. Somehow, this mix formed a box-office hit that spawned a Saturday morning cartoon, action figures, and a theme-park attraction. In hindsight, the success of a picture so strangely memorable—possessed dinner party guests lip-syncing “Day-O”! Killer sandworms! Robert Goulet!—seems obvious. But initially, the script was seen as an intriguing but ultimately impossible oddity. “Everybody wanted to own it,” Senelick said. “Nobody wanted to make it.” Luckily, what turned the studios off actually appealed to Burton, a former Disney animator fresh off his debut film, Pee-wee’s Big Adventure. “The things that interest me the most,” he told Rolling Stone in 1988, “are the things that potentially won’t work.” It took an extraordinary effort to make Beetlejuice work. Without the assistance of a pair of young development executives, a powerful media mogul, and a skilled rewrite man, the movie may have died before reaching the afterlife.

… Long before Beetlejuice, McDowell had become enamored with death. To him, it was something to explore, not fear or avoid. Laughing about it certainly wasn’t off-limits. “He had a devilish—not to say uninhibitedly morbid—sense of humor,” poet and critic Lloyd Schwartz wrote of his longtime friend in The Boston Phoenix. “Even at 19, death seemed to him life’s most grotesque joke.” Born in 1950 in Enterprise, Alabama, McDowell grew up reading the works of influential horror writer H.P. Lovecraft. In interviews, he also said that Chinese and Japanese occult films helped shape his sensibilities. “Not for anything specific,” he said, “but just for their way of treating the supernatural in a straightforward fashion, in a way that Americans never quite get. As a part of life.” In 1968, McDowell began attending Harvard. While at college he met Senelick, who directed him in a production of Bartholomew Fair. They went on to have a 30-year connection. After graduating with honors in English, McDowell pursued a PhD at Brandeis and began writing fiction. In 1978, he finished his thesis, American Attitudes Towards Death, 1825-1865. His first published novel, The Amulet, was released a year later. The Alabama-set Southern Gothic horror story hinges on a piece of jewelry that might be the cause of a rash of grisly deaths. This kicked off a run of pulp titles that included Cold Moon Over Babylon (1980), The Elementals (1981), and the six-volume Blackwater (1983). Among other books, he also pseudonymously co-wrote a series of gay detective novels. “He was a working writer,” said Senelick, the author and editor of more than 25 books himself. “He didn’t rest on his laurels.” McDowell took pride in his ability to churn out entertaining copy that was best enjoyed in the moment. “I think it is a mistake to try to write for the ages,” he said in Douglas E. Winter’s Faces of Fear, a collection of interviews with top horror writers. “I seriously doubt there will be anyone here in one hundred years.” He may not have considered himself to be a towering literary figure, but he was a writer’s writer. None other than Stephen King, for whom McDowell later co-wrote the movie adaptation of Thinner, once called him “the finest writer of paperback originals in America today.”McDowell broke into Hollywood in the early 1980s, first writing for pioneering horror auteur George A. Romero’s anthology TV series Tales from the Darkside. By the mid-’80s, he’d begun living part-time in Los Angeles. There he connected with Pecos Productions founders Larry Wilson and Michael Bender, who optioned some of McDowell’s books. At the time, Wilson was coming off a stint at Paramount. While attempting to prove himself as an executive at the massive studio, he said in an interview, he felt like he’d surrendered ownership of some of his best ideas. The experienced story analyst thought that returning to screenwriting would be more fulfilling than shepherding other people’s projects.

Soon, he started working with McDowell on what became Beetlejuice. The original story was significantly more sinister, particularly the lead role. “Betelgeuse was much more scabrous,” Senelick said. The character was supposed to be a homicidal demon, not a scheming, horn-dog exterminator. At first, the Maitlands died a truly gruesome death, and the Deetzes had not one, but two daughters. When McDowell and Wilson finished, the latter has said in interviews that he dropped the script off with an executive he knew at Universal, where he’d served as the director of development for filmmaker Walter Hill. The unnamed higher-up read the draft and a few days later called Wilson into his office. “He literally said, ‘What are you doing with your career?’” Wilson, who ended up with a story credit on Beetlejuice, recalled to Den of Geek. “‘This piece of weirdness, this is what you’re going to go out into the world with? You’re developing into a very good executive. You’ve got great taste in material. Why are you going to squander all that for this piece of shit,’ was basically what he was saying. It goes to show, right?”

Fortunately for Wilson, he had a backup plan. While teaching UCLA extension courses, he’d gotten to know Marjorie Lewis, a young development executive at the Geffen Film Company. She loved Wilson’s classes, during which well-known scripts were scrutinized and discussed. “I read everything,” she told me. “And I read faster than anybody.” In early 1985, Wilson brought Lewis Beetlejuice and asked her to read it. “I was blown away,” she said. The next day, she dropped the script on the desk of Geffen president Eric Eisner. She remembered imploring him to buy it, even going as far as threatening to quit if he didn’t. Lewis said that Geffen Film Company purchased the rights to the script that week. Burton was then wrapping production on Pee-wee’s Big Adventure for Warner Bros., the Geffen film division’s parent company. When the director read the script for Beetlejuice, he was smitten. “He thought he could have written it himself,” David Edelstein wrote in Rolling Stone. “It carried his trademark blend of the outlandish and the matter-of-fact.” But after Burton signed on to helm the project, the studio gradually picked apart the script, which at one point was titled House Ghosts. (Burton also jokingly suggested Scared Sheetless and was horrified when the studio actually mulled it over.) In those days, Mike Simpson at William Morris represented both Burton and Warren Skaaren. On the agent’s recommendation, Skaaren, a screenwriter who’d just finished rejiggering the Top Gun script, was hired to polish Beetlejuice. According to Rewrite Man, Alison Macor’s biography of Skaaren, he and Burton hit it off while spending time in the writer’s hometown of Austin. Fortuitously, Skaaren was the right person to improve a script about the afterlife. Like McDowell, Macor explains, Skaaren was interested in the subject of mortality. In fact, she reports, one of his favorite books was Ernest Becker’s The Denial of Death, a Pulitzer Prize–winning scientific rumination on the human response to dying. Skaaren, who consulted amicably with McDowell during the rewrite process, streamlined the story, punched up the jokes, and added more humanity to the characters. In her book, Macor describes Skaaren combining the two Deetz children into a single punkish teen daughter, who became more vital than in the original narrative. He also cheered up the ending, which Wilson said had Lydia perishing in a fire and living as a ghost with the Maitlands. And most importantly, Skaaren clarified what Betelgeuse’s powers were and molded him into an endearingly maniacal trickster rather than a flat-out murderer.

When it came time to cast the key part, Burton chose not to lobby for any of the era’s hottest comedic actors. Instead, he sought out Sammy Davis Jr. Lewis remembered attending a meeting to discuss the matter with Burton and David Geffen. “Tim was cool,” she said. “He looked like a character in Beetlejuice. He had on a ripped black sweater.” But as soon as Burton explained who he wanted to play Betelgeuse, Lewis added, Geffen exploded. After not-so-politely ranting about why Davis wasn’t right for the role, he said that he wanted Michael Keaton.

By the late ’80s, Keaton wasn’t exactly in demand. After starring in hits like Night Shift in 1982 and Mr. Mom in 1983, he appeared in the underwhelming Touch and Go (1986) and The Squeeze (1987). Still, the man who later became Batman turned Geffen down before finally giving in and taking the role. “You couldn’t back him into a corner,” Lewis said of the media mogul. “He’s the smartest man in the world.”

In early 1987, Beetlejuice was shot both on a soundstage in Los Angeles and in East Corinth, Vermont. The quaint New England town provided the ideal backdrop for the clueless excesses of the Deetzes, who turn an old house into a tacky art installation. (Designer Bo Welch’s sets are eye-popping). Burton encouraged improvisation during filming, a direction Keaton took to heart. “You show up on the set and just go fuckin’ nuts,” the actor told Rolling Stone. “It was rave acting. You rage for 12 or 14 hours; then you go home tired and beat and exhausted. It was pretty damned cathartic.”

The famous Belafonte-infused lip-syncing scenes, which led to “Day-O” being played on top-40 radio stations, only happened because the singer’s music was easy to license. Songs such as the R&B classic “When a Man Loves a Woman” (this was pre–Michael Bolton) were suggested, but were too expensive to clear. “Every time somebody heard the words ‘David Geffen,’” Lewis said, “they raised the price.”

Senelick enjoyed visiting the production. At one point, he met Old Hollywood star Sylvia Sidney, who plays Juno, the Maitlands’s cigarette-puffing (the smoke pours out from a slit in her throat) afterlife caseworker. When she noticed that her customary hotel gift basket contained a giant uncut spiky fruit, Senelick recalled her openly wondering, “What the fuck am I supposed to do with a pineapple?”

Senelick saw McDowell’s fingerprints all over the movie’s final cut, right down to the brothel that Betelgeuse visits. “It is actually based on a series of 19th-century French stereograph cards of devils doing various things in hell,” said Senelick, whose partner amassed a large collection of death-related artifacts that are now on display at Northwestern. “We not only owned the set. We also had a book about it, and lent Tim the book.”On March 30, 1988, Beetlejuice hit theaters. It took in $8 million in the opening weekend and eventually grossed $73.7 million in North America. The film, which had a $13 million budget, was a big hit. The movie resonated so much with kids that it was spun off into an animated series and a long-running stage show at Universal Studios theme parks.

Following the release of Beetlejuice, Warner Bros. green-lit Burton’s version of Batman. Keaton was cast as the Caped Crusader. Once more, Skaaren was brought onto a Burton project to rework the script. He received a co-writing credit with Sam Hamm, the same arrangement he had with McDowell on Beetlejuice. Batman premiered in June of 1989 and made more than $411 million worldwide. A year and a half later, Skaaren, 44, died of bone cancer. His second collaboration with Burton ushered in the era of superhero film franchises, but his first brought him more gratification. “He was proud of helping shape a character who on the page in some of those early drafts had been unlikeable and not accessible at all to the average viewer,” Macor said. “He helped make him so accessible that the character was getting fan letters.” Headlined “Fixed Movie Scripts,” Skaaren’s obituary mentioned that he had completed his final screenplay: Beetlejuice 2. The sequel, which according to Rewrite Man was titled Beetlejuice in Love, centered on a romantic triangle involving the title character, an opera singer, and her dead fiancé. Skaaren fell ill in the summer of 1990 and his script was later shelved. Burton soon came up with the idea for Beetlejuice Goes Hawaiian. Jonathan Gems even wrote a script, but it never panned out. Since then, rumors have swirled about the ghost with the most again being summoned to the realm of the living. It hasn’t happened. McDowell, too, worked on a Beetlejuice follow-up. He never finished it, but that didn’t bother him. “There’s an old Southern expression he used to like,” Senelick said. “‘I don’t like to chew my cabbage twice.’” McDowell worked with Burton once more, helping him turn a poem he’d written into the basis of the 1993 stop-motion cult classic The Nightmare Before Christmas. By then, Senelick said, his “workaholic” partner had begun to struggle both personally and professionally. “He’d work, and work, and work, and then he’d go out and play, and play, and play,” Senelick said. “The intensity burns people out.” Senelick said that McDowell started using cocaine in excess. Then he turned to alcohol. “He couldn’t work anymore,” Senelick said. “It got worse and worse and worse. I cut him off. I said, ‘You can’t come back to Medford, back home, until you’re clean.’” Senelick said that eventually, “He cleaned himself up. Totally on his own.” Then, in 1994, he was diagnosed with AIDS.

“It was the plagues of Job, basically,” Senelick said. “One damn thing after another. It was a pity because there was a lot more writing to be done.”

Unbowed, McDowell moved back East and taught screenwriting at Boston University and Tufts. Until the very end of his life, he continued to be a working writer. When he died, on December 27, 1999, McDowell was working on a film adaptation of E.T.A. Hoffmann’s The Nutcracker. His final novel, Candles Burning, was finished by Tabitha King and published in 2006. Recently, many of McDowell’s books have come back into print.

And while a Beetlejuice sequel may never happen, there’s a Broadway musical coming soon. Senelick is pretty sure he knows how McDowell would feel about that.

“I think he would be very hands-off,” he said. “If people wanted to do it and it works, then well, you get the royalties.”