If you are really lucky, like I was when I had this happen a while back, it is just a matter of your idle being set a touch too high. I found that if the idle was set at 1500-1600 (or higher), that it would sometimes hang up at 3-4k RPM when I came to a stop (or even if I just blipped the throttle). Turned idle down to 1250-1300 and problem solved. Thanks to Matt for that tip, so if it works for you, thank him. An alternative is an air leak, but that's another (less happy) story. Actually, re-reading your description more closely, if it rises to 4k after being at 1500, that would be different from what I had. Mine would not come down from higher RPM once I revved it. Still, it's worth a try to set the idle a little lower. Oh well, I tried. Good luck.
_________________
-Jim
'93 MC21