switch mosfet battery
MOS is not a current-driven device, so you do not need a Push-Pull Class B Biasing Totem-Pole to the Gate of a MOS Transistor (as proposed by someone earlier).
Also, never connect a resistor in series to the Gate to MOS Transistor. This serves no useful purpose at all. It's not even a current-driven device in the first place, so you don't need a current-limiting resistor to the Base. Such series resistance only causes unnecessary voltage drop across the resistor and RC delay to be imposed on connecting wire. This reduces the sensitivity of the optimal trigger voltage needed to switch the transistor.
The solenoid in parallel to the suppression diode in a Fly-Wheel circuit is definitely OK!
The polarity protection diode in series with the solonoid and the positive polarity of the battery is necessary and fine.
You need to understand some principles to tackle them accordingly.
1. The solonoid is an electromagnet in this application. It reacts very slowly to current change, due to Lenz's Law. The elevator door or a sliding door is a very good example. Collapsing the H-field too fast, it fails to work. Therefore you will need a optimal switching frequency. You need to adjust the pulse versus the period by adjusting the R1 and R2 resistors used in the 555 Timer. These resistors sert the duty cycle of the switching pulse. One resistor sets the duration of the charge phase, the other resistor sets the duration of the discharge phase.
2. An alternative method is to use a diode that can pass more current than usual, i.e. sinking less current either via MOS or a Darlington Pair. This slows down the collapse of the H-field when MOS is switched to sink the solonoid current, thus more current to pass the suppression diode and places your solonoid in Quasi-State (not fully turned off) i.e. such retention offers quick turn on of the solonoid again!
3. You have a choise of using MOS or a BJT or even Darlington Pairs. The aim is to switch the current and to sink them. Darlington Pair, preferably Sziklai's configuration is good because you can set the switching reference voltage lower than usual. Conventional Cascaded Darlington Pair would require two diode voltage drops across two PN junctions. However, Bipolar devices require current-limiting resistor at the Base. A MOS transistors do not require a current-limiting resistor at the Base. Most Power Electronics employs MOS instead of Bipolar simply because it offers high input impedance, low transistor resistance i.e. can sink more current, and more off-the-shelves options when you can choose various MOS transistors with different threshold voltage. More of your current is dedicated for your solonoid than the switching circuit if you use a MOS.