Did you actually see the raccoon wiggle through? A 2x4 welded wire fence should stop a raccoon from coming through but they are expert at finding any weakness, either under the fencing, over the top, through ill-fitting corners, doors, or windows. Or unlocking locks. I'd be looking for places they could squeeze through, especially at "connections" instead of assuming they came through the 2x4 openings.
To stop them from coming under the side, I'd install an apron. That's where you lay 12" to 18" of wire mesh on the ground outside the coop/run and connect it to the bottom of your coop/run so nothing can squeeze through. The idea is that a digging predator goes up to the side, starts digging, hits the wire, and does not know to back up. That also stops a chicken from digging its way out or a critter just muscling its way under a small hole under the fence. I use J-Clips or hog rings to attach an apron to a wire mesh fence but with a wooden base I'd use a furring strip and screws to clamp that wire to the base. That takes care of one problem at ground level or below.
As Stormcrow said the critter needs to complete the circuit between the hot wire and the electrical ground to get bit but you don't want a ground between the hot wires and the electrical ground or it will short out. The way you do that is to install the hot wires with insulators and wire it up so the wire mesh fencing is your ground. I'd also make sure the wire mesh is electrically connected to the soil so the soil is also a ground. Not sure how you attach insulators on a hoop shelter. I use posts.
Where to put the horizontal hot wires is the question. Obviously you want them on the outside. If you don't have dig protection you'd want that very low to the ground, probably no more than 6". It can short out if weeds or grass grow up in it or a rainstorm or strong wind washed or blows trash, dead leaves, or cut grass against it. That's why I like other dig protection. You'd want a horizontal hot wire maybe a foot off of the ground so a dog, coyote, or raccoon would check it out with its tongue or nose. If your soil is part of your electric ground and it touches that hot wire it gets a jolt and runs away. There is something satisfying to see a stray dog touch that fence, yelp, and run away. It is not hurt but it has probably run away for good. I'd want another hot wire up four feet or so just in case something does start climbing so it will get a shock and fall off.
Some critters can jump but they don't. They are almost certain to inspect it with their tongue or nose first. There is a difference in what a critter can do and what they will do.
Premiere1 has a great web page with examples of how to do this. I find them extremely good to chat with when I call. Very helpful in setting these things up. They may even know how to attach insulators to hoop coops.
I don't like raccoons. I typically permanently remove 12 to 15 each year. That's the point, 12 to 15 each year. I also get about 18 or so possum and maybe 5 or 6 skunks each year. You get one but you don't get them all, there are always more. I think permanently removing the ones that are hunting your area is a good thing, it reduced predator pressure but it is not a permanent solution. I especially like to reduce the number of skunks I run into at night.
I think good barriers are a better long term solution. That's why I talk about dig protection and closing up openings first. Electrical current is second because it doesn't work if the power is off or say a snow shorts it out. Once bitten they tend to not come back so it can still be a deterrent. A dog can help if it is allowed to be out there. If a dog sleeps inside during bad weather or it is cold or just because it is dark it's not helping you. Hunting or trapping is a temporary help. All these are tools to help you keep your chickens safe.