Without knowing exactly how you are coding it, it will be hard to know exactly what to do, however, if you change your way of thinking just a bit, you can see it is not really that difficult.
How about, instead of making the offset of the polyline a function to be executed after the importing of the CSV, make the importing of the CSV predicated on the function to offset the polyline. You should still be able to wait for user input.
In other words, don't call the function to offset the polyline from the reading loop, call the reading of the file from the offsetting function.