Okay, the last two lines are the issue here, I think. I'll start with the second-to-last one:
workflow.set_variable('age') = int(delta_t.days / 365.2425)
That is not valid Python (you cannot assign something to a function call). I think what you're trying to do is:
workflow.set_variable('age', int(delta_t.days / 365.2425))
The function workflow.set_variable takes two arguments. The first one is the name of the variable, and the second one is what you want to put into the variable.
And the last line:
action_out = workflow.set_output('age')
While that is valid Python, it probably doesn't do what you want. First of all, workflow.set_output doesn't return a result, so there's no need to assign it to action_out. You can simply write:
workflow.set_output('age')
But that also doesn't do what you're expecting - it sets the text "age" as the workflow output, not what's stored in the workflow variable named "age". I think you're looking for this:
workflow.set_output(workflow.get_variable('age'))
This gets the content of the "age" workflow variable, and sets it as the output of the action.