Super easy, barely an inconvenience.*
You just need to create a little Python tag to store the previous values from both sources, then you compare the new values against the old ones and find what the current source of change was. Then you use that data as driver for the new previous values AND the target. Done!
*cough*
import c4d
from c4d import utils
def main():
global PrevObjRotH, PrevObjRotP, PrevObjRotB
global PrevUDatRotH, PrevUDatRotP, PrevUDatRotB
obj = op.GetObject()
target = obj.GetNext()
ObjRotH = obj[c4d.ID_BASEOBJECT_REL_ROT