I'd recommend using a Git subdmodule for this. You can have a clone/checkout hook that will run your script to add file headers. It won't solve the read-only problem, but that can be circumvented anyway. You can then distribute any updates to your boilerplate by doing git submodule update
.
The caveat with this method is that your boilerplate must reside in a single folder. You could copy it out with your script but this will cause more problems than it solves.