2005–2011: The Book of Mormon
Trey Parker and Matt Stone, the creators of South Park, saw Avenue Q on Broadway. Lopez spotted them in the audience, and they went out for drinks. He expressed interest in a musical on Mormonism, a subject which had long fascinated Parker and Stone. The Book of Mormon premiered at the Eugene O'Neill Theatre on March 24, 2011, following previews from February 24. The show received many awards, including the Best Original Score Best Book of a Musical and Best Musical. The cast album also earne the 2012 Grammy Award for Best Musical Theater Album. The musical follows a pair of mismatched Mormon missionaries (Josh Gad and Andrew Rannells) who are dispatched to an AIDS-plagued Ugandan village ruled by a warlord. Ben Brantley wrote "in setting these dark elements to sunny melodies, The Book of Mormon achieves something like a miracle. It both makes fun of and ardently embraces the all-American art form of the inspirational book musical." He writes: "Mr. Rannells’s character beards the den of the evil warlord (Brian Tyree Henry) and, much like Julie Andrews in The Sound of Music, sings radiantly of his faith and hope and determination. The warlord isn’t buying any of it, and the priceless contrast between attitudes here is the difference between the world of musicals and the world of real life. The Book of Mormon thoroughly understands this difference. This makes all the sweeter its celebration of the privilege, for just a couple of hours, of living inside that improbable paradise called a musical comedy."
In 2006, Lopez collaborated with his brother, Billy, on several episodes of Wonder Pets!, for which they shared a Daytime Emmy award with the series' other composers and music director, Jeffrey Lesser, in 2008. Lopez and his wife, Kristen Anderson-Lopez, co-wrote a musical adaptation of Pixar's Finding Nemo, which opened at Disney's Animal Kingdom in January 2007.
On January 18, 2007, Lopez and Marx reunited to write four songs for the Scrubs episode "My Musical." TV Guide named the episode one of the best 100 TV episodes of all time in 2009. Lopez, along with Jeff Marx, was recognized with an Emmy nomination for the song "Everything Comes Down to Poo" from the above-mentioned episode. Stephanie D'Abruzzo, who created the roles of Kate Monster and Lucy the Slut in Avenue Q, guest-starred.
In 2010, Lopez wrote “Bet Against the American Dream” for This American Life. It parodiesThe Producers, where the two main characters realize you can make more money with a flop than you can with a hit, and plan to oversell investments in a flop. Lopez’s song applies the principle to Magnetar Capital, which used collateralized debt obligations and knowingly sold worthless stock, contributing to the subprime mortgage crisis. On June 25, 2010, Lopez won his second Daytime Creative Arts Emmy for Outstanding Achievement in Music Direction and Composition for his work on Wonder Pets! In 2011, Lopez reunited with Parker and Stone on the South Park episode "Broadway Bro Down.”
Lopez co-wrote two songs for Phineas and Ferb: "Aerial Area Rug" for the episode "Magic Carpet Ride" and "Fly On the Wall" for the eponymous episode. Lopez composed "Enjoy It While You Can" for The Simpsons episode "A Totally Fun Thing That Bart Will Never Do Again".