In my code, the CSV is first converted into an array => The completed line is deleted in the array => The array is saved back into the CSV
You could rebuild the script like this (after the csvSaveArray command) and save the information in the variable via storeText or similar, and then write this variable to the CSV via csvSaveArray.