Just found a way to make the changes visible in the dashboard as well.
First of all, let me say that I don't really understand why my code didn't work, as I used the existing scada symbols as a guide. I also adjusted the logging a bit and was able to see that the value stored for the color actually changed, even though the appearance didn't.
Fortunately, I was still able to get it to work by using element.css('fill', color); instead of element.attr({ fill: color });.