In Linux (Bash) there is a very useful functionality for dumping literal text out to another file like this:
cat > see.txt << EOF
contents going int
In your code is missing a single endlocal in your FOR-loop.
You create for each loop a new local-context through the setlocal EnableDelayedExpansion, this will explode with some more lines in your text file.
And to preserve the exclamation marks (and also the carets) you need the toggling technic DOS batch files: How to read a file?
setlocal DisableDelayedExpansion
for /f "usebackq skip=%startLine% delims=" %%a in (`"findstr /n ^^ %~dpnx0"`) do (
set "oneLine=%%a"
setlocal EnableDelayedExpansion
set "oneLine=!oneLine:*:=!"
set /a linesLeftToRead-=1
if !linesLeftToRead! LEQ 0 exit /B
echo(!oneLine!>>%outFile%
**endlocal**
)