About your second issue with the ReferenceError: If I understand the IntelliJ HTTP Client correctly, using an imported request and providing/overriding variables using that (@var = value)
syntax these variabled are created as "in-place variables", and according to this bug report in Jetbrains' Youtrack it's not (yet) possible to access those in the response handler JavaScript...