The core of this machine will double an bond oxygen atom on to the side of an existing molecule. It should then spin the molecule by 180 degrees and repeat.
This is a good loop to work from. The red waldo, already carrying a metal atom, enters this loop and starts double-bonding oxygen on each side. When should it stop, and how?
A sensor is required to break the loop at the right point. If the metal is zinc, the loop stops the first time through. If the metal is titanium it doesn't stop unless oxygens are bonded in both directions.
This is the same loop with the sensor in place breaking it when it is complete.
Here is the complete reactor design