How to rebuild iTunes Library with altered file locations without losing playcounts|ratings etc
There are a few AppleScripts from Doug Adams that might help you:
Fix Broken Tracks will merge the data of "dead tracks" (iTunes tracks designated with "!") with the real track that you have re-added to your iTunes Library.
iTunes Track CPR will check your library for "dead tracks" and re-add them while keeping all the previous metadata intact. In order for this script to work, the files need to be moved back to the iTunes Music Folder.
Music Folder Files Not Added displays files in iTunes Media folder which are not in the iTunes library.
It's important to read the manuals for these scripts before running them. Test a script only on a few tracks at first before running it on your entire library.
If you have the original Library.xml file, you can extract the play count and rating information from the XML:
<dict>
...
<key>Play Count</key><integer>5</integer>
...
<key>Rating</key><integer>100</integer>