I would just use a round blank box cover and drill a hole in it for your wire. A little dab of silicone where the wire comes out of the box would be good.
https://www.amazon.com/Morris-36850-Round-Weatherproof-Cover/dp/B005GDFLZU
The proper and legal way would be to put a box extension on that box and run your wire through conduit. I don't think all that is necessary. You could also just move the fixture down and mount it properly to the box thus avoiding the exposed wire.
I feel your pain friend. Some would advise against being petty and retaliating, but I’ve been exactly in your position and know what it’s like. The fact of the matter is that there are some people in this world that don’t give a single fuck how inconsiderate and boisterous they are. Trying to appeal to the better nature of people that operate this way is futile. They don’t care unless it directly affects them in some capacity.
One of the best methods of enacting revenge is as follows:
Order a surface vibration speaker that can be easily affixed to the ceiling. I’d personally recommend the Thunderpuck, Thump Box, or Mighty Dwarf. Yeah the sound quality on these things might not be the best compared to that of a conventional speaker, but that’s not important. Total wattage output is what counts here. A rare case of quantity over quality.
You’re going to need some way to properly affix, fasten, and secure it to the ceiling. This step is important because that speaker is going to rattle like a motherfucker and you don’t want it to come loose and fall. You can buy a cheap metal mounting plate like this one on Amazon for a few bucks. Secure the speaker to one side of the plate with either dual lock fasteners or a liberal amount of strong liquid adhesive like super glue. Just make sure you don’t obstruct the screw holes on the plate.
Once you’re confident your new Supersonic Vibrating Revenge Machine will absolutely not come loose, simply secure your device to ceiling with the proper screws via power drill.
Okay, now for the fun part. You’ve got a wide arsenal at your disposal of what you can play through the speaker only limited by your creativity. Sure, loud music of your choosing might be slightly bothersome, but what about the shell shock-inducing terror of a WWI artillery barrage ? Maybe the thunderous cacophony of celebratory fireworks played on loop for hours. The clanking and rattling of industrial construction site noises. Or if you want to go full nuclear and violate the Geneva Convention, a low hz bass frequency played at max volume will have your speaker vibrating and rattling around like a multistage rocket entering liftoff. These have undoubtedly yielded the best results in my experience:
Godspeed pilgrim.