"Sex, Pies and Idiot Scrapes" is the season premiere of The Simpsons’ twentieth season, and first aired September 28, 2008. After getting charged for being involved in a fight, Homer meets bail bondsman Lucky Jim and Wolf the Bounty Hunter, who convince Homer to become a bounty hunter. In a twisted turn of events, he becomes Ned Flanders' partner. Meanwhile, Marge unknowingly begins working at an erotic bakery. Julia Louis-Dreyfus returns as Snake's girlfriend Gloria for the third time. Robert Forster provides the voice of Lucky Jim, and Joe Mantegna returns as Fat Tony in the episode. It was watched by 9.3 million viewers the night it aired.
Due to his history of crime, Homer's bail is set incredibly high, and he is forced to get a bail bondsman named Lucky Jim to help him. Lucky Jim agrees to secure Homer's release from prison, as long has Homer doesn't skip his bail. Otherwise, he will have to deal with Wolf the Bounty Hunter, who quickly inspires Homer to become a bounty hunter himself. Homer's first mission involves pretending to sell condos on a street corner to criminals. Snake approaches Homer, who tries to take Snake down. Homer corners Snake in an alleyway, where Snake pulls out a pistol and fires a shot straight to Homer's head. Miraculously, Ned Flanders places a sheet of bullet proof glass in front of Homer, which deflects the shot. Ned and Homer manage to convince Snake to come in quietly. Homer, shocked with Ned's easiness, convinces him to join Homer as a bounty hunting duo.
At the bakery, Marge realizes that Patrick employed her at an erotic bakery after seeing Patty and Selma pick out a suggestively-shaped cake. Marge tries to quit, but Patrick says that there is nothing wrong with what he is doing, and that many of her friends have bought cakes from the store. Patrick informs Marge that she has a gift, and Marge agrees to stay. Meanwhile, Homer and Ned are successfully pursuing several bail-jumpers. Homer, now richer, spoils his family with gifts. Marge is equally proud of her job. That evening, Homer and Ned conduct a stakeout, hoping to take in Fat Tony. When he emerges next morning, Homer and Ned chase him around Springfield and eventually capture him by crashing their car into a subway car. Disgusted by Homer's unorthodox capture, Ned angrily quits. Ned tries to get out of the bounty-hunting business, but agrees to hunt for Homer after Lucky Jim informs Ned that Homer has skipped his bail.
When Homer arrives home to find Ned waiting for him, Homer declares that Ned will never catch him alive. A huge chase develops, ending with the two on a beam suspending high over the ground. Homer wails that he loved Ned, but Ned counters that Homer mostly hated him. Homer scoffs that it was only because Ned holds onto his resentments. Homer jumps onto another beam, but Ned fails to land on it, gripping onto the edge of the beam. He begs Homer for help, which causes Homer to flash back on all of the good times he and Ned had together; he helps him, but ultimately ends up tumbling over the edge of the beam himself. Shrieking, he and Ned end up landing in a pool of wet cement – which sets before they can get out. Chief Wiggum arrives to put Homer away, but in jail, Homer has been sentenced to a short stay. He receives a cake from Marge to "help get him through his sentence"; instead of something erotic as expected, he opens it to find a regular pink and white frosted sheet cake that simply says "to the love of my life".