But to get to your question, see http://en.wikipedia.org/wiki/Orbital_resonance#Possible_past... :
> A past resonance between Jupiter and Saturn may have played a dramatic role in early Solar System history. A 2004 computer model by Alessandro Morbidelli of the Observatoire de la Côte d'Azur in Nice suggested that the formation of a 1:2 resonance between Jupiter and Saturn (due to interactions with planetesimals that caused them to migrate inward and outward, respectively) created a gravitational push that propelled both Uranus and Neptune into higher orbits, and in some scenarios caused them to switch places, which would have doubled Neptune's distance from the Sun. The resultant expulsion of objects from the proto-Kuiper belt as Neptune moved outwards could explain the Late Heavy Bombardment 600 million years after the Solar System's formation and the origin of Jupiter's Trojan asteroids.[43] An outward migration of Neptune could also explain the current occupancy of some of its resonances (particularly the 2:5 resonance) within the Kuiper belt.
I think your statement "that earth is unusually dense" is incorrect. Earth's density is 5.51 grams/cc and Mercury's is 5.427 grams/cc. These are quite close. Earth's density is higher because of its higher gravity. When considered as "uncompressed" density, Mercury is much more dense than the Earth. See http://en.wikipedia.org/wiki/Terrestrial_planet#Density_tren... .