fsck_hfs keeps returning "The volume was modified"
Your disk is failing.

To answer your questions - yes, it attempts to rescue the data and mark the bad blocks so they won't be used in the future and no, there is no command to fix bad blocks.  Bad blocks are physical problems on the storage media.

The -S option, per the man page (man fsck_hfs):


  Cause fsck_hfs to scan the entire device looking for I/O errors.  It
  will attempt to map the blocks with errors to names, similar to the
  -B option.


(emphasis mine)

When you run fsck_hfs, it attempts to repair the file system - there's no guarantee that it fixes it.

In a previous post, I referenced that the hard drive in the iMac generally has a 3 year warranty (2 years after 2012) so basically, you're about 4 to 5 years into a drive expected to last about 3.  Chances are, it's failing.

I suggest replacing the drive.