Well, I just got an ej20k (a later model JDM WRX 2.0L), entire wiring harness, full TBE, axles, just everything you need for $1552 with tax and all. So, it's possible to get a good JDM engine for a good price, but for less than a grand I couldn't find anything but a JDM NA 2.5. Or an ej20h, which is what you were talking about with the dune buggy engine. They call it an ej20TT or something, but that isn't the right code. And a ej20g is a earlier model WRX and the very early turbo Legacys.
And to address the question about swapping that motor(ej20h) into a GC8 or GF8, it can technically can be done, but it's going to cost way more than a grand. Because you'll really need an entire front clip because you have to swap firewalls to mount your brake booster and master cylinder to the other side to have enough room for the second turbo. And then the only real good one I've seen they went ahead and converted to RHD! Which is better anyways!
I wish mine was RHD!
And if you really wanted you could swap your 97 motor into the 99, I'm guessing the 97 is a 1.8, since you didn't think you could just do that in the first place. But those ECUs are interchangeable. Well, I know the OBD1s are. But, now that I think about it I don't know if it'll work the same. I want to say that you could just run that 1.8 in your 2.2 99 with the 2.2 ecu with no problems, but with like the check engine light on.
I'm not 100% on the OBD2 ECUs, but I'd say it'd work just because everything else from the "ej" engine line is interchangeable.