Well, looking at the t cover spot, the wire doesn't connect to the HES so that throws out the thought of a security kill switch idea....... and it looks like it does not connect to the switch, so there are 2 different things to sort here...
Does your bike have a water temp gauge?
Follow the yellow wire to the end, I'd almost bet that it was added for a water temp gauge sensor. If I'm not mistaken water temp gauges were not stock on older RS bikes.
As far as the switch, does your bike have heated grips on it now?