You might just... replace the previous with, starting and ending with included first and last lines of your code:
COPY_EXISTING ~%file%.bcs~ ~override~
DECOMPILE_AND_PATCH BEGIN EXTEND_TOP
~cdtweaks/baf/reveal.baf~
END
BUT_ONLY_IF_IT_CHANGES
Or:
EXTEND_TOP ~%file%.bcs~
DECOMPILE_AND_PATCH BEGIN
~cdtweaks/baf/reveal.baf~
END
BUT_ONLY_IF_IT_CHANGES
or ... however one goes with that... and remember the BEGIN .. and END with DECOMPILE_AND_PATCH.
And you might want to use a LOCALS instead of GLOBAL in the .baf script, as that's for sure meant for the area and local creature scripts, aka this:
IF
Global("CDRevealArea","CD_MYAREA_VAR_SCOPE",0)
THEN
RESPONSE #100
SetGlobal("CDRevealArea","CD_MYAREA_VAR_SCOPE",1)
Explore()
Continue()
END
Becomes:
IF
Global("CDRevealArea","LOCALS",0)
THEN
RESPONSE #100
SetGlobal("CDRevealArea","LOCALS",1)
Explore()
Continue()
END
This will work on BG2... and IWD, but I can't say for non-EE BG1, or non-EE PST, yet.