There are two sub-threads here.
My understanding is that
Gandalf entered Dol Gildur which was then run by a mysterious wizard (who Gandalf did suspect, correctly, of being
Sauron but was not confirmed at the time). It was not mentioned as a
fortress populated with
Orcs and that would have been unwise, as then Sauron would have drawn too much attention to himself. However,
Mirkwood, stretching away to the north, became more fell at that time with
spiders becoming common.
Gandalf's purpose was, as I saw it, to advise, not to lead. Attempts by the
Valar to directly intervene in
Middle Earth had resulted in grief and tragedy, as free
peoples reject outside help from powerful entities, being suspicious and mistrustful when used to prevent problems. Thus, Gandalf was set to assist and advise, being the limit of what the Valar saw as practicable.
Sauron was the Lieutenant of
Melkor and one of the most powerful of his kind. However,
the ring was fairly dormant when Gandalf entered Dol Gildur, and Sauron was not strong enough to openly declare himself or reoccupy
Barad Dur.
Had Gandalf fought and won over Sauron at such a time, the 'free peoples' may well have been suspicious and wondered about the Ring of Power, likely thinking that it was destroyed to reduce the power of the
Elves remaining in Middle Earth or to prevent
Men from assuming the greatness of
Numenor.
Regardless, fighting Sauron would not have resulted in destruction for Sauron, as his spirit was bound to the ring and until the ring appeared and was destroyed, Sauron would endure. Imprisonment was proven not to work, as the
Numenoreans would testefy...