1) Safely patching system library functions with SetFunction(). I mean it looks easy enough, but I would happily take any advice on the subject
SnoopDOS is well behaving in this regard. You might want to take a look at SnoopDOS CVS:
snoopdos/patches.c