Hi! I'm Alberto Mendoza, from mexico, I can do the job, yes it's a simple project. I have some doubts about it, do you alredy have the electromagnet??? If so, could you send me the part-number or the datasheet of it? Can we use a step up/down converter as the power supply?? It's ok to use a frequency meter to display the frequency rate? and a potentiometer to control the frequency of the turn on/off?
And abour your question, yes, we need to use a diode to protect the mostef and the power supply.
Regards