Andromeda is at coordinates Dec = 41 degrees, HA = 0h 45m (11 deg)
The center of the milky way is at Dec = -29 degrees, HA = 17h 45m (256 deg = 360 - 104).
Imagine a standard 12-hour clock face, with the center of the milky way at the center. The Earth is at 12:32. Andromeda is in the direction of 2:38. Andromeda is about 2,500,000 light years away, while the milky way center is about 25,900 light years. The Earth orbits around the galaxy counterclockwise. So it needs to go around for 167 million years to get to the point where Andromeda is closest. You would want to start about 50 million years before that, to take advantage of the rotational speed.
But why wait 117 million years? Any reasonable probe is going to travel at at least 1% light speed, just to make the trip in less than 250 million years. Adding 0.52 million years doesn't seem worth worrying about. If the probe could reach 10% light speed, it would take 25 million years, and starting at the "wrong" time would add only 0.052 million years. Waiting for the natural rotation of the galaxy for the Earth to get to the "right" place mean waiting 117 million years. That would be like waiting over a hour for a bus to come along, just so you could take the bus for a trip of 1 foot!
By the way, any probe that could last in space for 25 million years is going to have to be smarter than all of today's human civilization. So it might as well be manned. It will be a few 1000 years before we humans have the technology to build such a thing. By that time, the distinction between humans and robots may be hard to see.