First, thank you to everyone for their help and their patience with an amateur. It is much appreciated (and very different to my experiences, especially with the software side, where there is always at least one person whose response is "Oh god! I cannot believe you cannot solve this! Get gud newb!"). What a great community.
In case it helps, here is a bit more of a writeup of what is what. In hindsight I should have started with this - my apologies.
*** The external input:
The external input will potentially come from a variety of sources:
1) A 3.7v battery (this is what I tested it with, and it worked)
2) A 9v battery
3) A number of units designed to trigger pyrotechnics. These units (which are sealed and I wouldn't mess with) put out a continuity check current that is limited to the "no fire" level for standard e-matches (which is typically 30mA). I measured this on one unit a while back, and it was about 12mA - but I'd like to design for 30mA, just in case. Once these external units are triggered they go open voltage across the outputs, which if they are connected to an e-match (which is just fine nichrome wire coated in pyrotechnic compound) drawn over 1A for a short time or until the fuse wire burns out. Depending on the unit this voltage can be between ~4.5V to 18V.
** The opto isolator:
I've just checked, and the board this prototype is using is a cheap Chinese board marked HY-M158. With a bit of digging it appears that the opto-isolator is a PC817 (Datasheet:
https://learnabout-electronics.org/Downloads/PC817%20optocoupler.pdf).
Also on the board is an in-line surface mount LED (type unknown - it is blue) and a SMD resistor marked "302" - so 3k Ohms (see picture attached).
From the initial testing I did, when a 3.7V (and 18650 LiIon battery) was connected to the input the opto-isolator would come on (i.e. the LED on the board would come on, and the MCU would detect the change on the GPIO).
** The other side of the opto:
The post above about the typo is correct - my apologies. It is pulled to 3v3 and it is the opto that pulls it to GND.
On the other side there is a connection from a GPIO of the MCU (an ESP32) to one side of the output side of the opto, and the other side of the output side of the opto is connected to ground. (I have removed the jumpers from the opto board, so the ground for the MCU board and the inputs is separate - with the MCU side connected to MCU ground.)
The connection from the GPIO to the opto utilises an internal pullup in the MCU, so that GPIO is HIGH until the opto opens, at which point it is pulled to GND and goes LOW - which the MCU, in software, then processes.
** The bigger picture:
Just for completeness (and not exactly linked to the thing I am trying to achieve) - once the MCU gets a signal that the opto has opened (i.e. it is pulled from HIGH to LOW, as an external signal is received) it send an output signal to a 5V relay, via a 3.3v-5v level shifter, to pulse on for a set amount of time - this is connected to a 240V circuit that is connected to a device that needs a pulse of 240V to activate - in this case a CO2-powered confetti cannon(!).
The timing and working of all that side is controlled by software - and seems to be working fine. The only issue is getting the external signal to work with an external trigger that is also providing a continuity check current (which is high enough to turn on the opto).
** Solutions:
The suggestion of running a resistor in parallel to the opto-led-resistor(3k) so that for the continuity stage the voltage is too low to turn on the opto seems like it might work. I'm going to try some calcs to see if I can get the sizing right and check the power dissipation. However, if anyone with more experience and knowledge is able to suggest a value for me to check against that would be much appreciated.
If there is another way of having it block or divert a current of under 30mA I'd be very interested. Sadly, I just do not know enough at this point to know where to start. There are 5 external inputs, so ideally this would be simple - but I'll consider anything that works. Logically, at least in my mind, it would be a node at which there is 'something' that does "IF current <30mA go this way (back to input ground), ELSE go this way through the opto". I appreciate that may not be possible or even close to simple.
Once again, thank you to everyone for their time and their help.