I fitted HID's to my E36, bought them from Cromelinedesign. Ben who runs the company sponsors one of the E36 forums so does good deals. I went for 7000k but 6000k appears the most popular for the perfect white look. The ballasts are waterproof and whilst I can't comment on the Z4 layout, I was able to screw them down to the back of the bumper reinforcement and the cables are not excessive or difficult to feed to the headlights.
As for the legal aspects, I too looked deep into this. Yes, it's a very 'grey' area. You don;t need to bother with all the self levelling and washers etc as that applies to 'supplied new' vehicles. HID produce a different beam pattern to Halogen and this is where the bad reputation of aftermarket kits comes from. ie the people fitting them to regular headlights such as Ford and Honda and many others that do not use projector headlamps. Therefore, the HID beam pattern hit the Halogen glass and the glass projects the beam pattern to the Halogen pattern and knocks it all out. When you fit the HID's to projector headlamps, the beam pattern remains the same and does not cause problems.
You simply take the H7 bulbs out, fit the H7 shaped HID bulbs and connect up the ballasts. I can't comment on error codes as my E36 doesn't have that option. As long as you get the headlamps aligned properly (your local MOT guy should be able to do this) the beam will not obstruct other road users and will work in the same way as regular Halogen, but brighter with a much crisper white light.
Never had a single problem with my HID's and as I'm a member of the E36 forum, the sponsor gave me a lifetime guarantee so any problems, he will fix free as long as they are fitted to the E36 and in my possession. Now that's a confidence guarantee! I've never had anyone flash me and never been pulled over for having them fitted. Sailed through the MOT and only needed slight adjustment as I'd just fitted the 17" alloys.
Of course, whilst you are 99% safe, there will always be that one strict MOT tester, or that police person who has had a bad day or just wants to be a pain, but you get that with whatever you do. In general though, it's a pretty safe risk to take.
I've tried the '50% brighter' halogen bulbs and wont bother ever again. Yes, you fit them and think they look great, but a month down the line you forget and begin to wonder if they have dulled down or if you just got used to them, with HID you notice the crisp white brightness every single time you turn them on.
And I've had mine fitted for about a year now and covered just over 20,000 untroubled miles.