This is untested so I have no guarantee it will work, but you could try using Pacifist to extract and install the Messages application from the Mac OS X installer image (there is a .dmg inside the Mavericks installer app you can download from the Mac App Store, that is what you want to open in Pacifist).
I just cloned my old system disk (OS X 10.10.2) into my new iMac. The only thing that doesn't work is Messages. When it opens there is just a blank window with "No conversation selected", Preferences is greyed out as are most of the other Menu commands. When I go to Text Message Forwarding on my iPhone (iOS 8.1.3), the iMac is OFF. When I turn it ON, there is no Code displayed on the iMac.
I would normally trash preferences at this stage, but there don't seem to be any to trash (just history).
Is there a way to re-install it, or do I have to re-install Yosemite? I think I'd rather do without it.
Whoops. I just realised this is the Mavericks forum. I'll re-post this in Yosemite