My advice is make it easy on yourself and do not code anything.
Of all the InfoPath forms I have seen, less than 5% needed coding. InfoPath has all of the functionality you need already built into the designer and can be configured without any code. If you understand logic and flow you have everything you need and can save your self a ton of time writing and debugging.
You can put rules and action in your form open rules to change whatever you need when the form opens. Make it as dynamic as you want.
Thats my two cents worth. :)