Something like this should work. Being mirrored means the width is negative. Using cos on the moving angle gets the horizontal movement. The ?: expression sees if the horizontal motion is negative.
Every tick:
— set width to abs(self.width)*(cos(self.moveTo.movingAngle)<0?-1:1)