Learnt quite a bit about the engine today.
It turns out that "enabling" the PicketpocketFailed() trigger also solves the auto hostile problem, so you don't need the previous exe patch.
[In fact I'm just replacing AttackedBy() with PickpocketFailed() but this isn't so obvious when you look at cryptic assembly listings.

]
COPY "bgmain.exe" "bgmain.exe"
PATCH_IF ((LONG_AT 0x5437B2) == 0xAA5E6C) THEN BEGIN
WRITE_LONG 0x5437B2 0xAA5F22
END ELSE PATCH_PRINT "0xBAADF00D"
BUT_ONLY
However, the invisibility problem is difficult to patch.
First off, I think you are leaving shadows as soon as you click on the steal icon.
And then there is an 0x88 effect (force visible) in the pickpocket code, that gets dispatched before the sucess of the pickpocket attempt is determined. (You could get away with a protection from opcode, but I don't think that's the right way.)