Sorry about the lack of feedback. Basically, there are quite a few severe limitations to the way pkg_delete currently walks dependencies.
Putting a band-aid such as your patch is not going to help, and yeah, redesigning that to work better is on my list.