Now that I think about it, "repairwallet" via the debug console should do the same thing, and it will be quicker.
I had to fiddle with this a few days ago when the client was doing some bizarre things like complaining I was trying to use already spent coins for a new transaction.