I have to format and reinstall OS X Mountain Lion on my Mac Mini (which already has OS X Mountain Lion) after restarting.
When I get it from WiFi, will it cost anything to install it, as apple is selling it on the Mac App Store?
It will not cost anything. If it needs to reinstall, it will ask for your apple ID. When it see's that you already bought Mountain Lion, it will install no problem.
If the device came with Mountain Lion, you bought the device and registered it under you apple ID, so it will still install.