@tanguatlay,
Once more unto the breach.
The correct punctuation allows you to move or remove phrases without the sentence losing sense:
1. Our immune system is constantly on the lookout for invaders, and once an enemy is spotted, (our immune system) mounts a complex attack.
Our immune system is constantly on the lookout for invaders, (our immune system) mounts a complex attack, and once an enemy is spotted.
Incorrect.
2 .Our immune system is constantly on the lookout for invaders and, once an enemy is spotted, (our immune system) mounts a complex attack.
Our immune system is constantly on the lookout for invaders and, (our immune system) mounts a complex attack, once an enemy is spotted.
Correct.
Delete the repetition shown in brackets.
The use of commas in the sentence is optional, bordering on superfluous.