Most of the answers you are looking for can be sourced from The Silmarillion which basically charts the First and Second Ages of Middle Earth and explains the motivation behind a lot of the characters.
You are absolutely correct that Gandalf wants the Dwarfs to enter The Lonely Mountain. The reason for this is slightly more complex.
Before Sauron came to power, there existed another Dark Lord called Morgoth (originally Melkor) who corrupted a lot of species and animals to create dark forces attracted to and subservient to him in order to take over Middle Earth and rule a land of darkness.
There are numerous sources but The Tolkien Gateway is a great source for Tolkien based discussions. For instance, on dragons:
Seeing the strength of the Noldor in battle, Melkor realized that orcs
alone were not sufficient to defeat his enemies. He therefore began to
breed a new race of monsters: the dragons.
Dragons were therefore created by Sauron's original master.
Gandalf was terrified that Sauron would be able to control Smaug and that there would be no hope if this happened. Although not certain that Sauron was alive he did not want to take the chance. This is confirmed in the book of Unfinished Tales, some of the appendixes in The Lord of the Rings and The Silmarillion.
Among many cares he was troubled in mind by the perilous state of the North; because he knew then already that Sauron was plotting war, and intended, as soon as he felt strong enough, to attack Rivendell. But to resist any attempt from the East to regain the lands of Angmar and the northern passes in the mountains there were now only the Dwarves of the Iron Hills. And beyond them lay the desolation of the Dragon. The Dragon Sauron might use with terrible effect. How then could the end of Smaug be achieved? (Return of the King Appendix A)
Gandalf therefore attempts to nullify the threat of Smaug by influencing Thorin to lead a company of dwarves to reclaim the lonely mountain.
I do not believe that Sauron wants the dwarves to enter The Lonely Mountain at all but he is somewhat indisposed at Mirkwood during this time more of which will hopefully be shown in the final Hobbit film. His collapse at Mirkwood leads him to retreat to Mordor.
It is also important to bear in mind that Tolkien himself changed his mind on the events of Middle Earth numerous times throughout his life and The Silmaillion itself was never published by Tolkien himself but by his son Christopher who believed this to be the best version of events from all of the written documents left behind.
Therefore, we might never know a definitive answer to events outside of the published Hobbit and Lord of the Rings.
I hope this helps.