About 5 years ago, I replaced the EJ25 in my wife's '98 Forester 5spd with an EJ22 from a '97 Impreza auto. It turned out successful, and we have put about 30k miles on it since the swap.
My EJ22 was also in a front-end collision. Yours probably faired better than mine. I didn't know when I got it, but it seems that the crank pulley must've been hit in the accident. I know this now because I can slide the crankshaft about 1/8" front-to-back. I know that's bad, but it has run fine that way for 30k miles.
My EJ22 also sat in a shed unused for almost 6 years. The only problem this caused me was that the 2 fuel injectors closest to the open fuel lines both seized up. I swapped in all 4 injectors from the EJ25, and it runs fine.
The wiring harness on my EJ22 had been hacked up, and I didn't get the ignition coil. I used the coil and engine harness from the EJ25. I had to cut some of the tape on the EJ25 harness to get some of the wires to stretch where they needed to go, but I didn't cut any wires. The coil didn't have the same mounts, so I think I just attached it with a single bolt with some thread lock.
I could easily be wrong about this, but I thought I once heard that the '96 and earlier EJ22s had something different about the number or placement of the bumps that the crank position sensor monitors compared to later engines. So when you change the timing belt, watch out for that. I'm curious to know if this is true or not.
I also had a strange problem with my clutch. I had to fabricate a shorter pushrod to go between my slave cylinder and my clutch fork. I never figured out why that was necessary, but without it my clutch could not fully engage and thus slipped badly.