Making modifications like this isn't something that's supported, but I could give you some high level explanations on what you need to get done. You will have to actually implement it yourself.
Are the page layouts going to be significantly different that they can't be modified using a css style sheet? What you could do is to load different style sheets for each of the different products. Then load the different style sheet depending on which product is selected.
I'm not sure which line you're pointing to on the products_Results page. Line 510 is just a closing div tag.