There is at least one other case where properties may be overwritten by some other not of the same type: a
font-variation-settings property with a value containing either "WGHT" or "WDTH" registered axes for variable fonts will always overwrite the
font-stretch, respectively. (no bug filed yet, but I'm mentioning it here for future reference when we attempt to fix this to have a general solution).
The logic to mark properties as overwritten in the Rules view is fairly simple at this point: it involves iterating all CSS declarations in ascending order of specificity, then marking them as overwritten when other declarations, higher in specificity, have a corresponding declarations. There's a check for computed values of sub-properties for handling shorthand notation.
One idea that comes to mind is to have a customizable set of conditions to check against when marking a declaration as overwritten. The existence of a prior identical property is one such condition. A dictionary of alternate conditions, for example
padding-left overwritten by
padding-inline-start is another. Likewise for
font-variation-settings and perhaps others we haven't yet considered.