I've always been fed up of getting the "An error occurred while running scripts from the package “XXXX.RecoveryHDUpdate.pkg”, so I followed my own suggestion of doctoring the script(s) so that at least the installation could run to completion and thereby show up in the install.log.
So, basically I followed the instructions in the OP for installing Security Updates. Downloaded the update manually. Added my board id and removed my model number as instructed. I also modified the replaceRecovery bash script - which is the one that fails (at the hdutil attach command). I commented out everything between creating and deleting the temporary mount point (which it creates in /var/folders). I know I could have commented out everything but I decided to only comment out the part that was causing the failure. I also edited the echo command so that I knew it was running my modified script. Repackaged per the instructions.
Suffice to say, the update ran to completion (no error report) and I got the Installation Successful dialog. About This Mac now reports build 17G4015. The security update also shows in the Installations list in System Report. The App Store doesn't show the security update as recently installed, but it also doesn't show the update as available anymore.
The other thing I did (and I don't know if this was strictly necessary) was to mount the Recovery partition and manually modify the System Version therein to say 17G4015.
No problems so far. I haven't tried booting into the Recovery partition yet but don't anticipate any problems.
Did you run dosdude1's Post Install Scripts again or rebooted without issues or performance lags after the update installation?
Could you please give some details on which files and what you modified:
I also modified the replaceRecovery bash script - which is the one that fails (at the hdutil attach command). I commented out everything between creating and deleting the temporary mount point (which it creates in /var/folders)