Building a powerful electromagnet for repulsion
In my experience (using magnets and designing metal detection equipment), 3 inches is a very long way for coils that might only have a diameter of about 1 inch.

At 3 inches, if you used two similar magnets can you detect the repelling force (or attracting force)? If not then you cannot expect an electromagnet to produce anything like the same magnetic field so it won't work at that distance.