If you enjoy your time working there, the right move was to give it back - it might actually end up paying you back better at some point down the road (in their eyes, anyway).
the only way you shouldve kept the money is if you had another job lined up already - otherwise it probably would've haunted you when you tried to move on.
besides, do you really need them harping on you for it? It sounds like it was a sizeable amount, so I doubt they wouldve given up without a fight.
sleeper is right, i meant over 5 months they overpaid you. arpi however is also correct, 40% of his salary would mean over the course of a year. 50% is a sizable amount. i agree with everything galt did, and how he feels about it now. i would have given it back because i would want to maintain my reputation in business a being a trustworthy person. i also think galt is right for feeling like leaving because of how they handled the whole situation.