I think maybe you just need to change the last part from this:
a = linear(time, 0, 1, startVal, endVal);
b = easeX(1, 2, [0,0], [20,20]);
a+b;
to something like this:
if (time < 1)
linear(time, 0, 1, startVal, endVal)
else
endVal + easeX(1, 2, [0,0], [20,20]);