On a project of this scale, you sholud seriously consider a modular aproach.
Design a "module" that can control a group of relays / electromegnets, test it and make sure it performs the way you want, then add more modules. If you chose to use shiftregisters as a way of expanding the digital outs on Arduino a suitable module size could be 8 electromagnets because most shiftregisters has 8 outputs.
One thing you should start considering from the start is your powersupply. powering 300 electromagnets is probably going to require a VERY large powersupply. You should probably also consider using more than one.