SemanticMerge is an existing commercial product that works in a similar fashion. I've found it much nicer to use than text-based diff tools.
https://www.plasticscm.com/semanticmerge/documentation/intro...
https://www.plasticscm.com/semanticmerge/documentation/intro...