In the following example echo on will take effect after the end of the brackets context is reached:
@echo off
(
echo on
echo ##
)
echo $$
In order to "activate" echo on in a brackets context (including FOR and IF commands) you can use FOR /f macro :
@echo off
setlocal
...