Clarify what you are actually trying to do. Do you mean return a variable’s value within the script or return it to a different script or automation, i.e. a response_variable?
You seem to be confusing script variables and Jinja variables. Your script variable, return, has no value, because the templating contains no expressions, only statements. If you want return to contain a dictionary there are two ways to do it, in YAML or in Jinja.