The lack of military invasions has certainly been a boon, but not sufficient to overcome the issues left over by Spanish/Portuguese style colonialism which created land owning aristocracies and rampant corruption. Argentina, Brazil, and Chile really all ought to be superpowers and Venezuela could have been richer than Saudi Arabia.
Sapiens and Guns, Germs and Steel discuss this some. The US also benefits greatly from its geography. Good farming land that stretches through a consistent latitude allows you to use similar techniques and crops across. The same is not true for more mountainous and longitudinally-oriented areas. I believe this applies more to continents than individual countries, and South America is definitely narrower and taller than the US.
Yes on the oceans, but having either jungle and/or a mountain range bifurcating a country tends to make it expensive to integrate into a cohesive country, so the benefits become more limited.