Let me start with " I'm not sure but...."
I have changed CDI's, stators and flywheels on 80 and 85 KDX and I have a '91 system. The 91 stator will not fit my 85 because of a difference in the bolting pattern (2 screws-old, 3 screws-new). My opinion is to give it a try. There is a slim but unlikely chance that there is a slight difference in the spark timing, but you can change/adjust that by rotating the stator plate. I'd put it on and kick it over. I can't imagine anything that would hurt or damage other components. If you just have a bad flywheel, I'd try just putting the 91 flywheel on your 87 stator. Kick it over with the plug out of the cylinder. If you see it spark, put the plug in and give it a go. If you don't have a spark with the plug out of the cylinder, then look for other problems. I like to change things one at a time and take it slowly.
Let us know how it goes,
Mark
KDX175
KDX200
XS850 Special