well, you could save the snake positions of the matrix, then check if the head position still in your body positions array, if it does, then throw a collision, its the simplest way i think, since i am not sure about raycast works with line renderer.
good luck