What effects does the motion of the Sun have on the perihelion precession of Mercury?
A better way to phrase that question is "What effects do the planets have on the perihelion precession of Mercury?"
When calculating the perihelion precession of a planet, one is implicitly working in a heliocentric frame, one in which the Sun is viewed as fixed. Perihelion precession is defined as the precession of the motion of a planet relative to the Sun. The motion of the Sun is irrelevant. The motion of a planet with respect to the barycenter is significantly more complex than is the motion of a planet with respect to the Sun. To illustrate, I'll quote from an answer I gave on physics.SE five years ago:
The following plot shows the distances between Venus and the Sun (red) and Venus and the solar system barycenter (black) from January 1970 to December 2014. The horizontal (time) axis is in days from 12 Noon TT, 1 January 2000.
Note that the red curve, the distance between the Sun and Venus, exhibits a key characteristic of an elliptical orbit, which is a repetitive, nearly sinusoidal distance curve. The black curve, the distance between the solar system barycenter and Venus, does not. It exhibits beats and other nastiness.
One way to model the behavior of a planet orbiting the Sun while acknowledging the presence of other planets is to treat the center of the Sun as the center of an accelerating frame of reference. This results in what aerospace engineers and solar system modelers call "third body effects". The effective acceleration of Mercury toward Jupiter in a heliocentric frame is the gravitational acceleration of Mercury toward Jupiter less the gravitational acceleration of the Sun toward Jupiter.
This approach combined with numerical integration could be used to model the entire solar system. Doing so would have the advantage of not having to worry about where the barycenter is. It has the disadvantage of making an already highly coupled set of differential equations even more highly coupled. That disadvantage outweighs the advantage, making solar system modelers use a barycentric approach when modeling the entire solar system.
Neither approach (numerically integrating the solar system from a heliocentric vs barycentric approach) was used to discover the problem with Mercury's orbit by Urbain Le Verrier in the 19th century. The numerical integration techniques currently used to model the solar system very much depend on digital computers, something that didn't exist in the 19th century. The number of calculations needed far exceeded the capabilities of the human computers available in the 19th century.
Instead, Le Verrier and others who followed used Lagrange's planetary equations, or variations of those equations to model Mercury's behavior. These equations yield the contributions of perturbing forces (or perturbing potentials) to the time derivatives of various orbital elements. In particular, what is $\dot\omega$, the time derivative of the argument of perihelion, for Mercury?
Le Verrier calculated that the planets would cause Mercury's orbit to precess by 526.7 arc seconds per century. By 1912, Doolittle (and others) had found some issues with Le Verrier's calculations and had refined the Newtonian effects of other planets on Mercury's orbit to a precession of 532.36 arc seconds per century.
Neither Le Verrier's value nor Doolittle's refinement agreed with observation. There was a 43 arc second per century discrepancy between Mercury's observed perihelion precession and the calculated values, which Einstein showed was very nicely explained by general relativity. Note that the relativistic effect is small, less than 10% of the combined planetary effects.
Doolittle, Eric. "The secular variations of the elements of the orbits of the four inner planets computed for the epoch 1850.0 GMT." Transactions of the American Philosophical Society 22.2 (1912): 37-189.