Biggest missing element if you want the arduino to be able to control the position of the internal magnet is that you need a feedback measurement method to know where the magnet is at any given time so the controls know how much and in what direction to power the electromagnet(s). A software PID controller would have to be set up most likely. While the overall effect would be very cool and appear simple the complexity of control is much more difficult then what one might expect. And on being able to reverse the polarity of a electromagnet requires an H-drive much like used for DC motors where you want to be able to change the direction (polarity) as well as speed (amount of average power).
Lefty