None of that should affect your print stringing as the commands should really only need to be run once per extruder (if that).
So I the absence of errors, I’m wondering if the Lin advance is struggling to deal with the large retraction required by the tool change?
While printing with your purge block, can you identify when the stringing occurs? Does it occur while the hotend is moving only to the purge block or does it occur while moving only from the purge block? Or both to and from? Does it occur in one material only? Or both material colours?
So we need to do more digging. Can you try a single material print with hotend 1 and a simulated purge block ie. solid cube to be printed with the same material as hotend 1. Then repeat this print with hotend 2 and simulated purge block also with hotend 2? Same result on both hotends? If differing results – tweak temperature settings with the stringier of the two until similar results. Is there a temperature difference to achieve the same results?