I would explain it that way, but I'm not CapedCrusader or Rob as I've only been doing this a little while myself and I'm not that familiar with it either, yet.

Which means I have to get on my other computer and actually try to figure it out the same way you are and see if I can make it work. Although first step is figuring out exactly what the code above is doing and then how to modify it to make it do what you need, right?
So the first part Caped gave us goes through the portfolio (that's the "foreach" part) looking for anything that matches "skKnow", ie. Knowledge skills. For each one it finds it's going to do the next line, and perform a macro, the #resspent part, which is just shorthand for a longer bit of code which we don't necessarily know but can infer that it deals with how much a Resource is going to cost us. In this case w'ere saying Skills (resSkill) needs to have some amount modified on it. Remembering that, again, we are only looking at a Knowledge skill that it had to find when we did the "foreach" part. So you can say it costs us 1 more (that's the "+, 1," part) or you could say maybe *, 2 to double it, for example. I don't know if that's right, mind you, but I think that is how that part works. Then it loops backing looking for any more Knowledge skills and making the program think it costs something other than the standard, but again only on Knowledge skills. So that should be for the validation stuff when the program just validates that what already exists on the character sheet matches up to what things should have cost to get there, but it doesn't do anything about when you actually try to spend an Advance on it.
The second part is to handle the Advance, I think. So again doing a foreach, but this time checking not the everything on the sheet, but only when doing an Advance and looping through Knowledge skills again. Then the next line, for any Knowledge skill it sees is being selected for an Advance, it then needs to increase that cost. I would have thought for the second one setting it to *2 (the asterisk means "times", BTW, if that wasn't clear) would be appropriate in figuring out if it was a lesser or a greater skill, but it may be a situation like you had before. Where we are SETTING it to *2 instead of adding an additional *2 modifier.
Does any of that make sense or give some thoughts on where to take it next?