Hello,
The script "garbageCollectTaskPersistence" is not expected to be run manually. Its purpose is to handle the data from within the TaskPersistence db only. It is not expected this script to handle the archiving process.
This script is invoked through the CA IM "Cleanup Admin Tasks" Admin Task which, depending of its options, does the archiving process too.
Best regards.