First thing I would try is, roll down that window and grab the frame at the top corner where it sticks out and give it a good yank toward the inside of the car.
If its just the window frame bent, that should fix that. I have a feeling it may have been crunched in the accident at the bottom hinge area, which would cause the top of the window frame to poke out like it is. That could be fixed by adding shims between the hinge and the body on the outside of the car.
If you've ever hung a door on a house, you'd understand what I'm explaining....