How far has the Earth traveled in space since its formation?

Just adding the distances isn’t going to get the right answer. Most of these coordinates from random Internet searches, so caveat emptor.

The problem is that we are not living in a flat universe. The plane of the solar system is tilted about 60 degrees to the galactic plane. Worse, the galactic angle the plane makes to the orbit of the sun around the galaxy isn’t constant since conservation of angular momentum means the Sun’s orbital plane always faces the same direction, whist the Sun’s orbits the galaxy. Overall this reduces the contribution to distance traveled by the Earth’s orbiting quite a bit. And it gets worse.

Movement relative to the CMB is 390m/s, but 620km/s towards the Great Attractor - towards somewhere 30 degrees above the galactic plane and at 272 degrees galactic longitude. Which is very close to edge onto the Earth’s orbital plane. All of which makes aggregate distances messy yet again. If the orbital velocity of the Sun is about 200km/s the Sun describes a flat spiral in space along the Great Attractor direction and the Earth’s orbit contributes a very nearly flat spiral motion (ie nearly zigzag) onto that.

The various flattening of spirals reduce the total distance travelled. The contribution from the Earth’s orbit is probably nearly halved. The contribution from the Sun’s orbit probably drops to three quarters. Very back of the envelope spit balling.

All of this assumes that the next higher component of motion is large enough that there is no retrograde motion. Which seems safe. Retrograde loops would really mess with things.

Alignment to the CMB reference frame is going to dominate any calculation. I have no idea if there is work trying to work out a history of the local cluster’s motion. It may be too chaotic to usefully try. Would be interesting if anyone has tried.