I think there is a fault in the formula
If( Goals Employee ID::Status = "unpaid" ) ; "Sum( Goals Employee ID::Amount To Pay );"" ) But I don't think it will work!
I think using a subsummary field that is a sub total of the Amount to pay sorted on the date or employee
It should be part of a script that finds "unpaid"
These are some pointers
I would do it a bit differently. Create another instance of your Goals Employee ID table and call it Goals Employee ID 2 and relate to your original Goals Employee ID using the Status Field.
And then create a field with the calculation (Total amount to pay):
If (Status="unpaid" ; Sum ( Goals Employee ID 2::Amount To Pay ) ; "")
Hope this helps :)