Go To Related Record can fail spectacularly if there is no related record to go to and you do not check for this possibility. The Complete Go To Related Record
That's not the issue here, but please be careful when using this script step.
IF steps cannot function as a case statement so your caset statement can only be evaluated inside it as True or False. You'd need to modify that part of your script like this:
If [Revenue::year = 2007]
Set field [Revenue::R2007...
Else IF [Revenue::year = 2008
Set Field [Revenue::R008...
//and so forth
You may not need a script at all for this. You could define 4 calculation fields to use in place of this script.
cR2007 could be defined as If ( Year = 2007 ; Data::Revenue ; "" )
Similar if functions can give you revenue for subsequent years.
An even more flexible approach is to not use any fields in Revenue at all for this. You can use a filtered horizontal portal technique to display the revenue figures from Data in different columns for each year. You can control the range of years that appear in the portals (a "horizontal portal" is really a group of one row portals) so that you do not have to keep redefining your calculations to add data for the next year.