In 1996, Westlund won election to the Oregon House of Representatives as a Republican. During four terms in the House, his most notable work was done as co-chair of the budget-writing Joint Ways and Means Committee, to which he was appointed in 2001. He unsuccessfully argued for the creation of a state sales tax as a means to balance the budget during a revenue shortfall. That same year, he co-sponsored legislation to create the Oregon Cultural Trust, and subsequently came under fire for seeking to head the newly created organization. He served on the Cultural Trust's board until his election as State Treasurer. In what would be Westlund's last House race, he defeated Democrat Cylvia Hayes, a Bend businesswoman who later became Oregon's first lady during the third and fourth terms of Governor John Kitzhaber. In 2003, Westlund was appointed to the Oregon Senate to complete the term of retiring Sen. Bev Clarno. He won election to that same seat in 2004, also gaining the local Democratic nomination and facing only token opposition on the ballot. He represented District 27 in the Senate, which covers most of Deschutes County and includes the city of Bend. During the 2004 election, Westlund endorsed Ballot Measure 36, which outlawed same-sex marriage in Oregon. After learning that research claims by Measure 36 proponents on which he had relied were rejected by the researcher, he personally called the researcher to apologize, expressing regret for supporting the measure. He subsequently sponsored a bill in the legislature to allow civil unions. That effort was defeated in part thanks to opposition by Speaker of the HouseKaren Minnis, wife of the officer who arrested Westlund in 1982. Civil union legislation was later resurrected and passed in the 2007 legislature, becoming law in 2008. Westlund was pro-choice and supported access to the morning-after pill. During his time in the legislature, however, he had supported some restrictions on abortion. In 2003 he backed House Bill 2547 and in 2005 he backed H.B. 2532. Both would have created a 24-hour waiting period for women wishing to receive an abortion and required doctors to read a statement to patients about abortion. In 2005, he also supported H.B. 2605, a parental notification bill, and H.B. 2020, which would have expanded Oregon's criminal homicide law, redefining "human beings" to include fetuses and embryos at any stage of development.
Statewide office
Following his switch to the Democratic Party, there was speculation that Westlund would run against Republican incumbent U.S. Senator Gordon Smith. On October 3, 2007, however, in a press conference attended by Governor Ted Kulongoski, he announced his candidacy for the office of Oregon State Treasurer. He won the Democratic primary and defeated Allen Alley in the November 2008 general election. He was sworn in on January 5, 2009. Westlund was one of the first statewide officeholders to be cross-nominated by the Independent Party of Oregon.
2006 Governor's race
On February 14, 2006, Westlund dropped his Republican registration, registered as an independent and declared his candidacy for Governor. While Westlund gathered over 36,000 signatures, he withdrew from the race for governor on August 10, 2006, citing that he did not want to be a spoiler in the election.
Health issues and death
Westlund was diagnosed with lung cancer in 2003, for which he underwent surgery, radiation and chemotherapy. Although the cancer was in remission for some time, Westlund died of cancer on March 7, 2010 while in office.