Making a process involving a two way path

Hello. I am making a project where my lector has inspired me to make it all simulated. the process involves a two way path stopping when a sensor detects an element waits for 8 seconds and then changes direction and takes it out. For it to stop midway and then go back once again to then go back to the beginning. Anyone that can help me program a python script that can do this.

Have you tried anything yet? Show us your code so it would be easier to assist.

You can take a look at this post Two-Way Conveyor (Human load/ Robot Unload)