iIf your country is already blockaded, putting mines in the enemy harbor would be good for you.
As a matter of fact (from wiki):
If placed by the owners of the harbor, sure.
An enemy dropping mines from a plane or using a sub to place them would hardly do that, would they?
It may behoove them to have the mines drift around the harbor and not sit in place, easily picked up and/or picked off.
Yes, certainly.
Looked it up on wiki and found some stuff:
So, not just a static defense. Usually, sure, but, could be used otherwise.
And:
So, drift mines, used offensively.
Again, if placed on a shipping route with a 100+ meters to the bottom it could hardly be anything but a drift mine.
And currents would be known, position for your ships to avoid them would be known, and possible position for the mines will get larger as time goes on.
Did they have mines that would deactivate after a time in WW2?
And, yes, cleanup is problematic.
During WW1 there was the North Sea Mine Barrage, where 70,000 mines were layed
Clearing the barrage after the war took 82 ships and five months, working around the clock.
Also:
https://en.m.wikipedia.org/wiki/Naval_mine#cite_note-Gilbert,_p.5-34