O'Brien was first elected to the Pennsylvania House in 1976 and served two terms before giving up his seat in 1980 to challenge fellow Republican Charles Dougherty for his congressional seat. O'Brien lost to Dougherty by 480 votes in the primary. In 1982 O'Brien ran for his old seat in the Pennsylvania House and won. He was re-elected in every succeeding election he contested. Prior to his elevation to the Speakership, he served as chairman of the House Committees on Veterans Affairs and Emergency Preparedness, Health and Human Services, Consumer Affairs, Judiciary. Upon leaving the Speaker's office, he served as chairman of the Committee on Children and Youth.
Autism
Inspired by his late nephew Christopher's diagnosis, O'Brien has been an advocate for autism issues and founded the Pennsylvania Legislative Autism Caucus. In over 20 years, he has proposed a number of bills requiring mandatory school and health care funding for patients. He worked with Governor Ed Rendell to organize a Bureau of Autism Services within the state's Office of Developmental Programs. In 2008, one of his bills, requiring insurance companies to cover autism treatment, was passed and signed into law.
O'Brien became the Speaker of the House following deals between Republicans and Democrats. Despite a one-seat Democratic majority, the Democratic leader, Bill DeWeese, was unable to garner the votes necessary to win back the Speakership due to some dissatisfaction within his own caucus because of his handling of matters as leader, and notably due to the decision by one member in his caucus to vote for John Perzel, the incumbent Speaker. DeWeese nominated O'Brien, a Republican and a Perzel rival, in a surprise move. O'Brien went on to defeat Perzel, 105-97. O'Brien was the first minority-party Speaker in the Pennsylvania House of Representatives.
2008 Primary Election
O'Brien defeated what was described as an “underground write-in campaign” in the 2008 Democratic primary election. With no Democrat on the ballot, a write-in candidate emerged in an attempt to secure a position on the November ballot as a Democrat. He organized his own campaign and defeated his opponent 1,372–416, meaning that O'Brien was listed on both parties' ballots in the general election.
Post-Speakership
Upon the election of 2008, the Democrats saw the opportunity to put their own in the Speaker's office. Representative Keith McCall of Carbon County was elected Speaker with O'Brien opting out of the race. He was named the minority chairman of the House Committee on Children and Youth. In addition to those responsibilities, O'Brien worked with the Department of Public Welfare to ensure implementation of Act 62 which he wrote and passed while he was the Speaker.
O'Brien announced his intention to run for one of the minority seats on Philadelphia's City Council in 2011. He, attorney David Oh, and incumbent Frank Rizzo were considered the clear favorites among the Republican contenders. On May 17, 2011, in spite of not being supported by any of the party organizations, O'Brien won one of the five GOP nominations for the City Council's at-large seats, with 17.32% of the vote. Oh won 18.50% of the vote, being first among the field of candidates, while Rizzo was soundly defeated, coming in 7th out of nine candidates—a result some have attributed to his involvement in DROP, the Deferred Retirement Option Plan. O'Brien went on to be the top finisher among the minority party candidates with an approximately 10,000-vote lead. He was sworn into Council on January 2, 2012. He was the sole member of Council voting to oppose a public water rate setting board, opting to instead leave that decision in the hands of the Water Commissioner.
2015 Council Re-Election
O'Brien again ran for re-election to one of the two minority seats. He faced a field of five candidates, including the other incumbent, David Oh. With 100 percent of the ballots counted, O'Brien lost to Oh and Councilman Al Taubenberger.