After 25 years, Judd Apatow is finally getting a shot at The Simpsons.

An episode of the animated series written in 1990 by the then-fledgling comedy writer will at long last air on Sunday. Apatow spoke with TV Guide about "Bart's New Friend" and how The Simpsons executive producer Al Jean resurrected the script.

"I was 22, a huge fan of The Simpsons, and hoping for a TV writing career," Apatow said. "At the time I was a fledgling standup comic and people said, 'If you want to write for sitcoms, you need to do spec scripts.' Only six episodes of The Simpsons had aired at that point but I tried to copy the style and did a spec script where Homer gets hypnotized and thinks he's a 10-year-old. He has such a great time being Bart's friend that he doesn't want to become an adult again. I sent it in — in fact, I sent it to all my favorite shows — and got no job offers. I also wrote a spec script for the great Chris Elliott show Get a Life. They at least brought me in for a meeting, but that didn't lead to any work, either. Then, all these years later, Al Jean calls and says, 'Hey, we'll make it now!'"

Jean heard about the script after Apatow talked about it on stage, but it wasn't exactly ready for the airwaves. "I had funny instincts," Apatow said. "That's about all. It's a pretty rough script — when I reread it I wasn't exactly glowing with pride — but Al and the staff did their Simpsons magic on it. The whole process blew my mind. Sitting at the table read, listening to Dan Castellaneta [Homer], Julie Kavner [Marge], Nancy Cartwright [Bart] and Yeardley Smith [Lisa] putting their brilliant spin on something I wrote back when I was a dreamer, was one of the greatest days of my life. These are legends! It was as thrilling as if I'd been allowed to sit in on the making of The Honeymooners."

Two years after penning the script, Apatow wrote and executive produced The Ben Stiller Show before going on to executive produce Freak & Geeks with Paul Feig. That led to writing and directing such films as The 40-Year-Old Virgin, Knocked Up and the upcoming Trainwreck, which opens July 17.