I think in Azure Devops pipeline we can use the concept of variable group(s). For example , you can create a variable group for additional environment variables and use that variable names in the InlineScript !!
Syntax to use : If the variable name is test , in the script field you can refer it by $({nameofvariablegroupname.test})
see the usage here:
One more alternative:-
Use script Type: FilePath , give the path to the script file
Regards,
Shiva.