This might help. Pulled it out of my archives and cleaned it up a bit:
########################################
############## Properties ##############
########################################
__author__ = 'Jacob Small'
__version__ = '0.1.0'
__description__ = """Gets the modified elements between the current document and a path to a previous version of the same document."""
__RevitBuilds__ = "2023.1"
__DynamoBuilds__ = "2.15"
__ReleaseNotes__ = """-"""
__Dependancies__ = "Revit API 2023 or later"
__Copyright__ = "2024, Autodesk Inc."
__License__ = """MIT"""
########################################
################ Import ################
########################################
import sys #add the sys class to the Python environment so we can work with the sys objects
import clr #add the CLR (common language runtime) class to the Python environment so we can work with .net libraries
clr.AddReference("RevitNodes") #add Dynamo's Revit nodes library to the clr
import Revit #import Dynamo's Revit node class
clr.ImportExtensions(Revit.Elements) #add the element conversion methods to the CLR
clr.AddReference("RevitServices") #add the Revit services library to the CLR
import RevitServices #import the Revit services class to the Python environment
from RevitServices.Persistence import DocumentManager #import the document manager class to the Python environment
clr.AddReference("RevitAPI") #add the Revit API to the CLR
import Autodesk #add the Autodesk class to the Python environment
from Autodesk.Revit.DB import * #import every class of the Revit API to the Python environment
from System import Guid #import the .net GUID class into the Python environment
########################################
################# Code #################
########################################
results = {} #empty dictionary to hold the results
# get data from the current document and append the GUID as a string to the reuslts
doc = DocumentManager.Instance.CurrentDBDocument #the current Revit document
currentVersion = Document.GetDocumentVersion(doc) #the current document version
currentVersionGuid = currentVersion.VersionGUID #the current document version GUID
currentVersionGuidString = str(currentVersionGuid) #the current document version GUID as a string
results["Document Version Guid String"] = currentVersionGuidString #add the current document verison GUID as a string to the results dictionary
currventVersionSaveNumber = currentVersion.NumberOfSaves #get the current version number
results["Current Save Number"] = currventVersionSaveNumber #add the current save number ot the results dictionary
#get the old document information
oldDocPath = IN[0] #the old document version GUID as a string from the Dynamo environment
basicFileInfo = BasicFileInfo.Extract(oldDocPath) #get the basic file info from the old path
oldDocVersion = basicFileInfo.GetDocumentVersion() #get the document version from the basic file info
oldDocVersionGuid = oldDocVersion.VersionGUID #get the old document version guid
oldDocVersionGuidString = str(oldDocVersionGuid) #convert the old document version GUID to a string
results["Old document version GUID"] = oldDocVersionGuidString #add the old document version GUID to the results dictionary
oldDocVersionSaveCount = oldDocVersion.NumberOfSaves #get the number of saves at the old document version
results["Old Document Save Number"] = oldDocVersionSaveCount #add the old document save number to the results dictionary
saveDif = currventVersionSaveNumber-oldDocVersionSaveCount #get the number of saves between the two documents
results["Document Deltas"] = saveDif #Add the number of saves between the two document versions to the results dictionary
#get the document difference
docDif = doc.GetChangedElements(oldDocVersionGuid) #the document difference
#Get the new elements and append to the results
newIds = docDif.GetCreatedElementIds() #get the new element ids from the document difference
newElements = [doc.GetElement(i) for i in newIds] #get the new elements from the document
results["New Elements"] = newElements #add the new elemetns to the results dictionary
#get the modified elements and append to the results
modifiedIds = docDif.GetModifiedElementIds() #get the the modified element ids from the document difference
modifiedElements = [doc.GetElement(i) for i in modifiedIds] #get the modified elements from the document
results["Modified Elements"] = modifiedElements #add the modified elements to the reuslts dictionary
#get the deleted element ids and append to the results
deletedIds = docDif.GetDeletedElementIds() #get the deletd element ids from the document difference
results["Deleted Element Ids"] = deletedIds #append the element IDs to the results dictionary (not fetching the elements from the document as they no longer exist anyway
########################################
################ Result ################
########################################
OUT = results #return the results to the Dynamo environment