Will this work?
diff(RingElement,Product) := (d,p) -> sum(toList(apply(#p, k -> Product insert( k , diff(d,p#k) , toList delete(p#k,p) ))))
The business with "insert" just puts the differentiated factor back in the same position it came from. If you prefer it to be at the end (last factor in each summand) then this should work:
diff(RingElement,Product) := (d,p) -> sum toList apply(#p, k -> delete(p#k,p)*diff(d,p#k))
Zach