There are differences. Not major ones but ones to be aware.
The 87 has a EGR system. The 89 does not. 87 is banked full injection while 89 is, I forget the word, I want to say multiport, but I think it is correct, both have same amount of injectors and such it just comes down to how they are controlled.
The ports on the 87 throttle body are larger than the 89.
So if you move the engine there is other stuff tailored to the one engine like the ECU that moves. I don't know how much wiring difference there is. Obviously some. And other accessories like alternator may differ (I was told there was 2 or 3 styles of alternator on the 87.
I've never done an engine swap, just know of these few differences. I don't know what the best way to deal with them.
I don't think basic block hasn't changed so swapping the short block I think should work, but don't take my word on that. If you are moving it as a long block you have the wiring and ECU differences.
I've heard of people putting an 88 ECU in an 87 and deleting the EGR functionality. And heard something about how the bigger throttle body ports combined with the 88 computer can yield better fuel economy (88 and 89 computer I think are pretty much the same, both are non EGR)
That's the extend of my knowledge with a bit of rumor tossed in there.
Good luck.