The statistic returned could be the time taken to complete the transfer, or how long it took the script to run. Maybe even how large the file is. The choice is up to you. The script exit code is was determines if the script completed successfully or not, so you'll need to ensure you map the failure/success of your script to the appropriate exit codes listed below.
The script statistic and optional message return format must be structured in the following format (example below). You can return a maximum of 10 statistic and message pairs as the result of a single script, but the minimum requirement is at least one statistic in the "statistic.1:X" format.
If you need assistance getting the sample script I provided above working with SAM, I recommend asking community members in the Thwack Script Lab forum.