So, I was able to fix the issue, and the script is now working perfectly. Below, I will outline the steps I needed to take in the hope that it will prove helpful to anyone else who may be experiencing similar issues.
Firstly, it's worth double-checking the "Safe Shutdown" switch inside the case. In my previous post, I stated that it was set correctly; it wasn't. Turns out that I routed my cables poorly during my first assembly attempt, and this repositioned the switch, so definitely double-check that. There is, apparently, a really helpful diagram in the manual. However, for people like me who are unable to read it, there is an easy enough way to verify that the switch is set correctly. Set the case in front of you, with the SSD compartment and USB ports at the front, and the power, Ethernet etc ports at the back. Then ensure that the "Safe Shutdown" switch is positioned towards you. After I fixed my mistake, the script installed properly.
However, I then ran into another issue. The buttons on the front did invoke the script. Problem is that the system would crash before properly shutting down. The only way to break out was to pull the power cord. Luckily, a solution is offered in this Github issue:
https://github.com/RetroFlag/retroflag-picase/issues/101
Essentially, it's necessary to ensure that you have the correct firmware installed for the top case/SSD bay, Otherwise the script won't run correctly. There are separate firmware versions for booting from a Micro SD card and booting from an SSD. You need to use the firmware which matches your boot configuration. For example, if you're booting from a Micro SD card, it's necessary to ensure that the matching firmware is installed.
It seems that the process can only be carried out on a Windows machine; for me, a Windows VM was sufficient. You'll also need to first disconnect the top case from the Nespi4, and connect it to your computer.
The firmware can be downloaded from the following page. Just scroll down and select "Firmware Download":
http://www.retroflag.com/nespi-4-case.html
You'll end up with a zip file, which will need to be extracted. You'll then have a folder called "How_to_boot_from_SSD". Open this, followed by "Method 2 update firmware". Run the "FwUpdateTool_v1_19_16_24.exe" file, doesn't require installation. In the update tool, click the "Load File" button, and browse to the "Firmware" folder in the aforementioned directory.
This is the crucial bit, as you need to select the correct firmware according to your boot preference. If you want to boot from a Micro SD card, choose "JMS578_STD_v00.02.01.04_UAS.bin". If you want to boot from an SSD, choose "JMS578_STD_v00.02.00.09_NO_UAS.bin". Then click "Run", and wait a few seconds for the firmware to install. Click "OK", and safely remove the top case from the computer.
After connecting everything back together, the script should run without any problems. Just to be safe, I started with a fresh installation of Recalbox, and installed the script.
Of course, all of this may be thoroughly detailed in the manual; I wouldn't know.
Anyway, I hope that this is helpful to someone.
Cheers️.