Instead of using TMR for measuring duration, look at the MATH TICKms() function that returns a hardware timer register in millisecond counts. The value itself does not mean anything, but using it to do calculate time deltas is perfect for this.
So store that value, then on the event you want to measure, call TICKms() again and take the difference. The delta will be the duration, but as a signed DWORD. The modulo math will just work even if those TICKms() values appear negative or any combination of positive and negative. However, the delta must be LESS THAN 0x7FFFFFFF or 2,147,483,647 (largest positive signed DWORD) milliseconds, or slightly less than 25 days???
Will that work better for you?
FYI, you can use MATH TICKus() (microsecond hardware register) to PROFILE PLC INSTRUCTIONs. Stick MATH w/TICKus() before a (set of) instructions, then another MATH directly below it to take the difference - you get the actual hardware execution time of those instruction(s) in MICRO seconds. You are just doing it for grainer real-world event time measurement via TICKms().