Easiest explanation is to think of a battery hookup like on a car. Red=positive terminal, feeds all power out to the vehicle. Black=negative, ground wire for all components. Connected to vehicle frame etc.
Your bike: Yellow=stator output, supplies all power to the bike (engine running). Green/yellow=ground wire to all components. Connected to frame and engine. If you use a voltmeter set to ohms you should get continuity from any green/yellow wire to ground. The ground is common to the frame and engine. Your ohms reading would be very low, less than 1 ohm, indicating a circuit. A high reading (megohms or infinity) indicates no connection.
I can't say for sure about your bike, but it should have a ring terminal with a yellow/green wire bolted to one of the coil mounts, or somewhere else with bare metal on the frame. Maybe someone used a black wire in place of the yellow/green. IF the yellow/green is not connected to ground, maybe that's why your lights are flashing. There could be arcing going on.
Please cut your harness cover open and follow the yellow/green wires and see where they go. Or push/pull the yellow/green wires back and forth in the cover and find out where they hook up. Somewhere along the way you need to find out where the yellow/green wiring is grounded. You will need to make the ground connection yourself if it's missing. It's the "other side of the circuit", nothing will work properly without it.
So you have a grounded black wire? Follow it around and make sure it connects to a yellow/green wire somewhere. The black wire on your voltage regulator also connects to ground.