First off, it turns out I was mistaken -- you can't use the SwitchView method while the changed event is running. See this blog post for more information and a possible work around.
As far as learning to code for InfoPath, for the 2003 OM, Patrick Halstead's book Developing solutions with Microsoft InfoPath is a great starting point. I don't have any IP 2007 books, but a quick look on Amazon brought up Designing Forms for Microsoft Office InfoPath and Forms Services 2007 by Scott Roberts, and it looked pretty good. You may want to give those a try! MSDN is also a great resource... I think they have some labs you can walk through.