If you word shift, you want to keep it around every 250 meters.
How you do it is you keep the location of the last “position check” in a variable, then use a distance node between where you are and where you were.
If > 250m you call the shift.
That said. Converting to integers via Truncate as you did is probably enough to remove errors anyway?
Have you tested this method on the compass movement without the shift?
And to be a little more precise, I would only use the Truncate on the line trace. No need to cut the position itself since no math will be done on the float points.
But if it does not work, you can also Truncate the rest.