Hi,
From Cata version you can maybe check Usefuls.FrameTime_GetCurTimeMs().
On all version, you can check Useful.LastHardwareAction (this counter is updated when there is a keyboard input or when the mouse moves in the wow window).
Relogger use "WowProcess.Responding".
But, checking every 50ms seems almost impossible.