I wouldn't give the crate 8-direction behavior at all!
Here is one idea:
Surround the player with 4 (or 8, in the shape of an octagon for diagonals) invisible collision detectors. They should be very thin and 'border' the player.
Then, you can simply check the crate for overlapping the individual detectors, and tell it to move away from it on overlapping.
This should get you the required result.