I found a useful diff script and I adapt it to fill my need, this script is intended to be used in the action menu and compare the text of the current document with the text on the clipboard, in the future I want to create it an UI that allow to select the two documents to compare, if someone want to help, it would be great.
Edited to add the link of a repo:
https://github.com/mncfre/Document-Diff