If the utility was forcing the eMMC to correct itself, one erase block at a time, the failed block number would be increasing (it is).
The failed block number decreasing would mean that the eMMC controller has run out of good eraseblocks to map in.
In the case of your file -
The script and the eMMC are doing exactly as intended.
Each time it is run, the previous contents written are found to be correct and then it continues to extend the correct contents.
The number of blocks
newly written is not significant, it may be as small as one block.
Just as long as it continues to extend the correct contents.
Keep on repeating the script as long as it continues to extend the 'found correct' contents.
KEEP IT ON EXTERNAL POWER use a wall charger, not a PC port that might go to sleep on you!
The erase / re-program eMMC process is very power hungry and we do not know the condition of your battery.
I am assuming your writing mmcblk0p1 (the 'main' system).
Also, that you used KindlTool to extract the main kernel and main system image from the current 5.6.1.1 Amazon update file.
Otherwise, all you have done is confirm the script works and the eMMC can be recovered.
If you are not, the device will try to do an OTA update, and fail.
The OTA updater does not use a copy&confirm flash algorithm (high dollar SSDs, the 'server grade' ones, do this internally).
The Kindle fastboot does not do a copy&confirm when it is writing either, so don't be surprised if you have to use it multiple times to get a correct copy of the 5.6.1.1 kernel written.
Once you get a complete copy of that, reboot to main, and then put a really big file on mmcblk0p4 (user storage).
Use a file of all 1's - that is 'erased' on flash storage. The micro-controller should be smart enough to know that all it has to do is 'erase' not 'erase and re-program'.
(That feature could probably be added to the script - just repeat using the same block of 4K 1's as the source file.

)
(just touch the desired end of the file - a sparse file will do) and repeat.
(Its fat-32, which does not support sparse files).
That should get you most of the bad blocks mapped out by the internal eMMC controller.
I have found the mmc utility:
https://www.mobileread.com/forums/sho...&postcount=887
But it probably isn't of any help in this situation.
But have not found where I posted the finished version of this script and its package.
= = = =
The cost of this help is that you should answer some questions here placed by others.
I
CAN NOT devote time to this forum. Health too poor.