The M1005 X(n) Y(n) command, where n is in millimeters, is iterative. If you issue the command again, a second correction is added to the first. I also think that it may not be saved when the printer is powered off. My memory is a little weak on this because it has been a couple of years since I dealt with skew.
There was a long discussion on the subject here, and I concluded that the M1005 I(n) format, where n is in radians, is preferable. I have this Machine start G-code addition (and cheat sheet) in one printer preset, un-commenting lines as needed. I only needed to run it once. The printer skew is corrected, and remains corrected, for all my prints and presets.
;===================Skew correction=============================
;M1005 P0 ;Disables skew compensation. Retains stored value.
;M1005 P1 ;Enables skew compensation
;M1005 I-0.00042; Stores correction factor in radians
;M1005 I0 ;Resets correction to zero
;M1005 ; outputs current skew settings to /tmp/syslog.log
That last command is really only useful with the X1Plus firmware, which lets me issue G-code commands from the printer display and records the responses in a log. Using X1Plus, I can use SSH and the built-in text editor to access the log and see the current skew status:
26 Apr 5 10:32:46 info forward[2060]: [MCU][BMC]M1005:comp_enable = 1
26 Apr 5 10:32:46 info forward[2060]: [MCU][BMC]M1005:current XY_comp_ang = -0.00042
This example shows my printer’s skew settings shortly after power-on. It lets me verify that the radian correction remains after power cycling, without using M500. The value is the total compensation, not a modification to a modification. (Ignore the time stamps, I forgot how to find the log and fell into another rabbit hole while searching. Like I said, I don’t mess with skew anymore.)
I compensate for filament shrinkage in the filament preset.