@zetaPRIME is actually the one who added SD mounting/unmounting for GodMode9, I just happened to already have a fork of GodMode9 for other reasons and the code was very little so I just added it into mine. But yes, I use the same feature for my very own NTRBootHax Pack which is all done with a single script. Also, Boot9Strap kicks in before secret sector is used, so the state of secret sector does not matter when you have boot9strap installed, restoring it first is just done so that should you ever remove boot9strap your console will boot normally again. Leaving an A9LH secret sector when installing boot9strap won't brick it.
As for dspfirm, there's a feature request for LZSS decompress for .code files. With that, we may be able to use the inject command to extract a dspfirm from either the Home menu's code.bin or from the System Settings code.bin. For now though, you could just include the DSP1 cia in the package. When this CIA is run it has the option to exit and delete itself, so it only takes 2-3 seconds to run.
You don't need separate scripts, since the o3DS doesn't use secret sector in normal operation, you can just restore secret sector on both n3DS and o3DS. Also, it's not entirely needed either, since boot9strap doesn't use the secret sector. But to make it safer you can just reduce it to the one script that always restores it from a file on the SD.