Ardruino programming

I am working on a project to move a camera above my cnc router and my different lasers. I have a belt drive and guide rod system that I have built and mechanically works soundly but I am having a problem with the adruino programming as I used to program efficiently. But in the past year i have started suffering from a neurological pathway issue that has taken my hearing and am now deaf in one ear and have an issue with memory and extrapolating information at times.

I am using my old Makeblock Orion as I have a couple laying around.

I have been programming using blocks instead of line of code and it has helped but I have not been able to get it fully programmed so I am hoping someone else can help.

What i want is when I press a set of Normally Open contacts it will rune till it hits a set of NO contacts on a limit switch and stops, Then pressing another button and it will run the other direction and stop at the other limit switch. The block programming is requiring my to put in limit switches as the buttons which is fine. I currently have it where it runs one way when i press one button and the other way when i press the other button. I know I have my loops built wrong but I can’t seem to remember which way I am supposed to use them. This brain thing is a killer.