I've been looking for a free vst that does this on and off for the last couple of years. :/
I really feel like this could be included in Reaper, or someone ought to program something like this in JS. This could actually help Reaper as a DAW, since there is currently no free vst plugin that does this.
Anyhow, I had good results with this fairly cheap software:
http://www.acondigital.com/us_StudioClean.html
(Depends a lot on the actual clicks / glitches I guess. Try out the demo..)
If you're looking for a piece of software that does this "offline", there actually are several solutions.
Just google "free declicker"