For correcting MIDI timing Quantizing is probably your best bet.
Select the clip(s) and then select Process--->Quantize. That will open up the settings window where you can set required resolution etc.
As the settings are material dependent the best thing to do is have a play around with the settings. If you leave Strength and Window at 100% you'll get a very mechanical result though.
I'd suggest starting with strength around 70% and window around 75% but that's just a starting point.
Try it if you don't like the result just undo it adjust and have another go. Playing around with those figures will give you an idea on what works for you.
The "Strength" setting just determines how well Sonar corrects the problem so 100% corrects an out of place note exactly - which probably isn't the best setting unless you want robodrummer.
The Window setting determines how far from the grid a note has to be for Sonar to correct it. 100% corrects everything 50% and it only gets those halfway or less between grid points.
HTH