What if the first and last quotes from Wilfred say it all? Ryan wasn’t happy; he was sane but, he was depressed and saw Wilfred as more than a dog. Ryan was insane when he saw Wilfred as more than just a dog and once he realized it, he avoided Wilfred until he was sane. Once he was sane, he admitted he hated how ordinary his life was again and became so depressed that he tried to commit suicide (like he did in the first episode before Wilfred). Then he accepted his lack of sanity so that he could let Wilfred back into his life and he was happy.

He chose happiness over sanity