Multicolored geom_line

Thats probably not the issue as you can see by changing the example you linked to that geom_line can tolerate that approach:

time <- seq (1,7,1)
var1 <- c(3,5,7,2,3,2,8)
var2 <- c(2,4,18,16,12,3,2)
DF <- data.frame(time, var1, var2)

ggplot(DF, aes(time, var1)) + 
  geom_line(aes(group=1, colour=(var2>10)))

for specific help with your code and data, consider providing a reprex.