Hansen worked as a stationary engineer before entering political life. His first efforts at public office were unsuccessful: he was defeated in a bid for municipal office in 1985, and finished third against Liberal Harry Pelissero in the provincial election of 1987 in the riding of Lincoln.
The NDP unexpectedly won a majority government in the 1990 provincial election, and Hansen defeated Pelissero by 1,012 votes in a rematch from 1987. He served as a backbench supporter of the government of Bob Rae for the next five years. In 1994, he was one of twelve NDP MPPs who voted against a government bill extending spousal benefits to same-sex couples. This decision cost Hansen the support of many within the party.
The NDP were defeated in the 1995 provincial election, and Hansen finished a distant third in his bid for re-election, behind Pelissero and the winner, Progressive Conservative Frank Sheehan. He has not campaigned for re-election since this time.