The goal here is to use global variables to save the content in Script 1, and then recall them (after the calculations part also in Script 1) to use for final total-type comparisons on Script 2 and 3, within the same project of course.
There are two ways, you can create another GlobalVariable.dVal3 which stores the computation result, or you can use def dVal3 = WebUI.callTestCase('your test case ID')
Where your test case would be like:
// compute dVal3
Use global variables when you want test cases that are relatively independent of each other to read it. Return value from WebUI.callTestCase if you want to orchestrate a logic flow where one test case returns a value which to be used by another test case. Note that all of this coordination occurs in another test case which can be called a master test case that simply orchestrates the flow between test cases.