Replace or repair derailleur?
Replacing it is the more economical option in almost all cases, especially on lower end stuff (esp. once you include labor) -- you can't source the parts for many lower end derailleurs.

On higher end parts it may be possible to send it out to a company which rebuilds derailleurs or rebuild it yourself with parts, but again, the labor and parts will likely outweigh the cost of just getting a new one (and the new one is less likely to fail; the rebuilder may make screw ups). 

So, I'd almost always replace, unless I had a good reason not to (e.g. someone who insists on vintage parts and wants that vintage part repaired). Or if its a tiny deviation (which wouldn't occur if the derailleur went into the wheel; that's generally toast).