I forgot to change default import settings for some 6000 heightmap patches, but I’ve successfully got the script to enable Read/Write for them. The problem is, that despite the inspector showing it’s R/W enabled I get an error that says it’s not enabled, it gets fixed if I reimport it manually.
Well I just solved my own problem by reimporting with: AssetDatabase.ImportAsset(path);
(There will be lag.)