A colleague of mine has patched an issue with grades restoring (in core Moodle it only works if the users were enrolled manually) so you may want to take a look at this:
MDL-36024
We've implemented it without errors and it has helped out immensely.