It works by having a clock that basically set the filters to first be iron and then copper, and if the inserters get something in their hands the clock stops until the train leaves.
Just wanted to share this funny (and overcomplicated) thing.
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
if you want a better explanation of what does what, just ask
![Wink ;)](./images/smilies/icon_e_wink.gif)