Can I get an app for free if I already purchased it on the same account, but on a different computer? I bought the Xcode app from Apple's Mac App Store last night on a computer which I ended up returning. I now have a new Mac. After logging into the App Store, I am asked to repurchase the app.

Should I do it? Will it know that the app has already been purchased on this account? Is there a way to re-download it instead of repurchasing?
Yes, if you download the same app off of the same account it will be redownloaded for free without charging your account again. The same goes for apps on the iOS App Store.