Well...I don't know if the KLR/KLX frames are the same (don't think so) but just measure the distance between the engine mounts on both bikes, see if they are close at all.
Another thing to consider would be pipe mounts, this can be difficult with a 2 smoke going into a 4stroke frame, although I've seen it done.
Yet another complication can be the alignment of the front and rear sprockets. If its only off by a few mm's it can be fixed pretty easily with some simple spacers, but sometimes they can be off by a few inches.
Bottom line, do some research first. I am guessing that a 89-94 200 motor would fit best or even maybe a KDX250 motor. It may end up being alot more work than being worth it.
Define "total rebuild"- is the tranny messed up or just the motor? Is it a valve train problem? If you need a new piston/rebore maybe look into a big bore kit, would probly be easier and maybe even cheaper than swapping a KDX motor into that frame.
Good luck and keep us posted. :)