Consider following modification. It uses the different meanings of '::' as label on the one hand and as comment on the other to construct different contexts:
::dummy--[[
@echo off
set f=%0
if exist "%f%" goto run
set f=%0.bat
if exist "%f%" goto run
set f=%~f0
if exist "%f%" goto run
set f=%~$PATH:0
if exist "%f%" goto run
for %%d in (%path%) do if exist "%%d\%0" set
f=%%d\%0
if exist "%f%" goto run
for %%d in (%path%) do if exist "%%d\%0.bat" set
f=%%d\%0.bat
if exist "%f%" goto run
:run
lua52.exe "%f%" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto :EOF
::--]]::
print( "hello lua" )