I just ordered a sunroof motor on ebay should be in by Tuesday I'll let you know if that fixed it for me.
After using the special tool to open it manually I've been able to open it about half way with the switch although only about 2" at a time which is why I think it's the motor or at least the hall sensors in the motor that are bad.
This link
http://www.e90post.com/forums/showthread.php?t=468137 has info on the electrical system that controls the roof I tried looking for a more detailed schematic but wasn't able to.
If anyone has the Bentley manual an can PDF the sunroof pages that would be greatly appreciated.