I recommend using Scripting App (versus Automation scripts) to start out because dealing with input/output is much easier in Scripting App. I also recommend starting your script with a completely blank script for your learning process and adding on from there, versus starting with an existing script written by someone else.
Start by writing a script that can input a record, save the current cell value for the field to a variable, and then output the value of the variable. Since this will eventually be an automation script, use
console.log() for your output for now. You will also want variables for the table and the record.
Then add code to that script that tweaks the value of the variable as you want. You might be able to copy a couple of lines from the original script for this. Output the tweaked value using
Add code to the script to update the original record with the new value.
Finally, convert the script to work as an automation script. You will need to learn automation input variables and how to get the record values from the input variable.