I ended up working around the issue by editing the problem build script with vi from the terminal, but this isn't a great solution. It kept failing on the library module builld.gradle.kts, so it wouldn't let me edit the root-level one. It kept re-syncing and returning to edit the module-level script.