OSX's defragmenting is done on the fly every time a file under 20MB is opened. If it's fragmented, it'll be moved elsewhere on the drive so it's in a contiguous area. On top of that is a feature called adaptive hot file clustering - so that 'hot files' (or files that the filesystem detects to be frequently accessed) are moved together to a faster portion of the disk AND defragmented.
As long term file use changes depending on what you're doing, long term, files move in and out of the hot zone.
In total, that means files that can benefit from being defragmented get defragmented, small often-used files end up placed in an optimal position on the disk, and fragmentation is minimal - and only on files large enough for fragmentation to be no real issue.
The scripts that apps like MacJanitor will run for you are separate processes to the auto defragging, and do things like cleaning up temp files, rotating log files around, rebuilding the 'locate' and 'whatis' databases, etc.
If you want to see exactly what those are, the scripts themselves are:
/etc/daily
/etc/weekly
/etc/monthly
There are a couple of things OSX's inbuilt systems don't do - they won't defragment files that are larger than 20MB, and they won't
optimise placement of files on disk except for hot files (the small frequently accessed ones). Most people say that's all a system needs, a few others will defragment regularly and claim it speeds their systems up every time.
As for bad blocks, that's something I'd keep an eye out for. If they seem to be growing, I'd not reformat the drive - I'd make a final backup and then burn it or something
Dana