I already have a very effective one made(yes in jass, kind of a duh) basically it loops a GetLocationZ(loc) check to see if for the direction the bullet is traveling (the 3 dimensional direction) if it would ever find the bullet below the ground.
Then also I have a checker that looks for dodadds in the area and checks to see if they are bullet blockable dodadds and if they are in a 90 deg direction in front of the unit. after it decides that it is an object that blocks bullets it sees if the object is in the direct path of the target and if it is, it sets the distance between the 2 as the max distance of the bullet. if it finds another object closer that is in between the 2 it sets that as the new max distance
So actually that bottem paragraph is the first code to run. So after it finds the max distance of the bullet(which is the distance from shooter to target if there are no objects blocking.) then it runs the GetLocationZ check(which I call a Line of Sight(LOS) check in my code) and then if the LOS and the Object Stop check return true, it hurts the target and if false it does not and creates the effect wherever it decides the bullet stopped instead.
And I run alot of fully automatic paced guns on this system and it doesn't slow down a bit. And trust me when there is a leak in a system that runs this often you find out pretty quickly. even one leak slows the comp horribly down in about 10 minutes.