Andy, check and test all signal light bulbs(even if they look OK), check wires/grounds and plugs for damage and corrosion. IF all are OK, change signal flasher, if still not working could be the multi function/light switch faulty.
As far as sunroof problem opening and closing on it's own, forums I have read say it is the sunroofs potentiometer faulty. Check the attached links,instruction and guides, Good luck.
I hope this helped you out, if so let me know by pressing the helpful button.
http://www.audiworld.com/forums/a4-b5-platform-discussion-1/sunroof-opens-closes-itself-280089/
http://www.audizine.com/forum/showthread.php/303762-Sunroof-Mind-of-its-Own