For p_SortD, affecting de doesn't matter because if you follow the code path, the next occurrence of de is when it is loaded from hl, so its contents don't matter.
As for p_Mod, ac is the division result, which is never needed. You can also notice that in the original routine, the new bits shifted into ac are never read.
Edit: fixed grammar

Also, some peephole ops I would find useful.
1 2 3 4 5 6 7
| .db 3 sbc hl,de ld a,h or l .db 2 sbc hl,de
|
1 2 3 4 5 6 7 8 9 10 11
| .db 8 ld de,$0000 add hl,de sbc hl,hl inc hl dec hl .db 6 ld de,$0000 add hl,de sbc hl,hl
|