I've been putting off adding something to my vampires addon that would require just this kind of scripting. So I haven't actually made anything work yet, but I have some ideas on how it could be done.
First off, you can use global variables. Basically, from the fired EH, you add the shooter to a global array. Then in the hit EH, you check the global array to see if the unit was hit by somebody who just fired.
Now you would have to put a time or something in the global array too. So basically one entry in the global array might look like: [shooter, time shot, weapon, bullet]. After a second you remove that entry from the array. Well, thats the rough idea, I'm sure it would have to be changed around a bit.
Another way to do it would take more resources, but would be more likely to work and be accurate. In the fired EH, you make a loop that follows the bullet, constantly checking if anybody is near. If the bullet terminates very close to a unit, then it hit that unit, and you continue with the script.
Well, both ideas are very rough ATM, so I hope you understand the meaning Im trying to convey. I'll try to explain/figure it out more later.