In case anyone else encountered this problem. You have to edit your function and check the "has return value" box. Then your return will work. After this you have to use "Call Function" again and now you have a new field for saving results.
The long answer is that BAS has its own internal code generator, which means that everything in the BAS XML was generated by that system.
However, I strongly do not recommend writing code by hand. It will be extremely difficult to update and understand the code later based on what you wrote today.
@Sytehel
Use the "Template" action from the "String" module
5197c678-0d01-4941-95db-66a3edba53ec-image.png
90359299-f59e-4236-8633-f456017797bb-image.png
54bcfa80-8c0b-48b5-a526-0b38e60acbf8-image.png
The issue was with window.outerWidth == 0 in BAS, and some startnge code window.outerWidth || window.innerWidth from recaptcha service. If window.outerWidth == 0, so function, which calculates screen width, returned window.innerWidth which was always 304px, because code executed in captcha frame.