the OP asked to replace the instance(s) of LocalCompilerPresent=1 after the first one. Your script will only work if the wanted line is in the line immediately following the searched one. If there is a blank line in between, it will fail.
Your script will print both the original and replaced lines.