Don’t try to sell the house until you correct stuff. Use colored electrical to ID green wires that ARE NOT ground, etc.
I wouldnt do any more ‘live’ work without the whole house breaker off.
I deal with dc voltages from solar panels that are hot anytime the sun shines. Thats fun !!
The switch and lights in question will not be around much longer. I’m going to have the pros rip them out and run a dedicated circuit for motion floods (mostly because I’m too old to crawl around in my attic).
We just bought this place a few years ago and have no intention of leaving any time soon. It’ll all be fixed to my liking before we retire.