It would detect the height of the raft by looking at what the first Z coordinate is that it encounters on layer 0. This Z coordinate also includes the initial layer height though. If you pause lower than the initial layer height (but higher than 0), you'd expect to pause in the initial layer.
Because we can't set the temperature and we don't know the correct temperature to set it back to, we will just retract further in order to prevent damage to the material.
Contributes to issue CURA-5491.
Instead of deriving this from the g-code flavour, just use the actual settings that are made to control these two properties.
Contributes to issue CURA-5491.
There is no such command to disable only the E stepper drivers. This command M84 gets interpreted as disabling ALL stepper drivers, which on some printers would cause the print bed to fall down.
It has to iterate over all layers and do string comparison to find the index back. Instead we just keep track of the index so this should improve performance a bit.
Instead of making lots of nested if statements, use the if statements as an interruption check. This reduces the indentation a lot and makes it easier to read in my opinion. It also makes it easier to add stuff to these checks.