To write each tag from only one direction:
- PLC sets trigger tag
- Script runs on trigger tag change, does stuff, and sets handshake tag
- PLC clears trigger tag when it sees handshake tag
- Script runs on trigger tag change and clears handshake tag
This should make a race condition pretty unlikely,