It's his first post here, I think it can work though. Lots of changes have to be made though. Don't forget, magneton was RU last gen, which is not great, but at least not NU.
1) Firstly, to run a defensive set, max out a defense and don't max out the other, invest in HP.
2) Toxic + Thunder Wave + Discharge won't work. You need to choose one status move - Discharge is best, having a good chance to paralyze and doing nice damage.
3) Since protect and toxic are out of the system, rest + sleep talk is in, as a form of recovery and will choose a good move usually, occasionally choosing rest.
4) Flash Cannon is a good filler.
Magneton
Item: Eviolite
Nature: Bold
Ability: Sturdy/Analytic
EVs: 252 HP, 252 Def, 4 SpAtk
- Rest
- Sleep Talk
- Flash Cannon
- Discharge
By the way, magneton's defense + eviolite is killer:
252 Atk Life Orb Iron Fist Infernape Mach Punch vs. 252 HP / 252+ Def Eviolite Magneton: 88-109 (28.9 - 35.8%) -- 20.7% chance to 3HKO
252+ Atk Dragonite Fire Punch vs. 252 HP / 252+ Def Eviolite Magneton: 92-110 (30.2 - 36.1%) -- 46.9% chance to 3HKO