how could measuring the orbit of a comet help scientists understand when it will next be visible on Earth?

If you measure the orbit, you know period. Period is the time between subsequent passings.