MOSFET won't turn off

Here is where it is getting problematic. I wired these up very simply. literally a wire from pin 9 to gate, source and drain with a big old magnet in middle and a flyback diode to handle things when the magnet turns off.

It's not clear where things are hooked up from your description. First, I would put a resistor between pin 9 and the gate, else pin 9 will be driving into a very large capacitance that can damage the pin driver. Second, exactly what is going on with source and drain? I'm thinking you want the source connected to 0V and the drain connected to one end of your electromagnet, with the other end connected to 12V.

If the magnet is always on it means it's either miswired or the MOSFET has been destroyed and it is shorted. Any chance you can sketch up a quick schematic to see what you've got wired up?

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, light sensor, potentiometers, pushbuttons