Turn anticipation is done entirely in Nasal.
The approach is quite simple (a bit too simple, actually, but I prefer something that works somewhat OK over something that doesn't work at all): I just regularly check the distance to the next waypoint, whether that waypoint is marked as fly-over, my ground track speed, and the required turn angle to the waypoint after the next one. From those, I can calculate the turn radius (based on ground track speed and standard turn rate), and then using the required turn angle, I can calculate how far from the waypoint I need to initiate the turn. So then I just compare my actual distance to the waypoint to that, and if it's smaller or the same, I just select the next waypoint in the route manager, which causes the autopilot to turn towards that waypoint. Unless it's a fly-over waypoint, that is; in that case, I just leave the route manager alone and wait for it to automatically advance the waypoint as I fly over it.
The logic is, for hysterical raisins (as in, I have been too lazy to refactor this mess) in instrumentation.nas, specifically, here:
https://github.com/tdammers/CRJ700-fami ... n.nas#L274.
From a quick glance, yours looks like it uses more or less the same logic, give or take a few hacks to catch edge cases, and different correction factors.