Curses!
Indeed, I was well aware that the two events are entirely unrelated. I was just referring to the lively dynamics of The Local Group to illustrate the remoteness of the timescale considered when we talk about The Universe expanding indefinitely. Yes the Sun will likely still be kicking when we crash into Andromeda, but by then - at least according to most models-it will have expanded to the size where it will have engulfed the Earth- or pushed the Earth's orbit farther out into the solar system- in either case The Earth's atmosphere will have long been stripped away by the Solar wind. As a cooler red giant It will have fused virtually all of its hydrogen and most of its remaining supplies of helium and will be puttering out as it struggles to make do with carbon and oxygen.