Is there any prioritization?
There is no prioritisation as such. The code executes line by line but if it is in a loop during which the line sensor is nor being read then obviously it cannot react to it.
You need to break the actions into small sections so that they each occur repeatedly and rapidly giving the appearance of multitasking. Have a look at Using millis() for timing. A beginners guide, Several things at the same time and look at the BlinkWithoutDelay example in the IDE.