Sometimes, actors choose film roles based on the script, and sometimes it’s something else that attracts them. In the case of “Killer Joe,” Gina Gershon said she couldn’t resist an opportunity to work with William Friedkin . As much as she liked the writing, Gershon was thrilled to work with the director of one of the actress’s all-time favorite films, “The Exorcist.” The actress, who’s perhaps best known for her roles in “Bound” and “Showgirls,” was in Boston Thursday to promote the new Friedkin film, which costars Matthew McConaughey , Emile Hirsch , and Thomas Haden Church . Gershon fondly recalled her days as a student at Emerson, and the frequent train trips to New York to see plays. She said the four-hour jaunts were just long enough to finish her homework.