I dont think sasuke has really changed his mind about getting revenge. i think he is just having doubts, i also think that he is trying as much as possible to eliminate any threat that might stand between him and his revenge. And one of the main threat is Uchiha madara if madara should complete his infinite tsukyomi his revenge would be meaningless so why not try to eliminate that threat and afterwards have his revenge. what do you think?