So back to my earlier suggestion. If you do something like...
define var = $var_value
...
select '&&SCHEMA..test' from...
...at start of your SQL script you can still use your here document and the SQL will largely be compatible elsewhere. You'd only need to change the DEFINE for your vars when executing on Windows.