When my ABS and ASC lights were on, the problem turned out to be a faulty front wheel sensor. If it's intermittent it might just be a bit of road dirt or brake dust.
I invested in a BM Cables diagnostic kit that I downloaded onto my laptop only to find that it wouldn't read the ABS module on my pre facelift Z3.
I did a bit of research and found that the most common reason for ABS/ASC problems were faulty wheel sensors. The problem I had was that there is one on each wheel and I needed to find out which one was faulty.
I drew a blank with the diagnostics so decided to take a shot at just changing one at a time. Research told me that the front wheel sensors were the ones most likely to be the culprits.
Next thing was whether to go with OEM parts at £80 each from BMW or £78 each from Euro Car Parts. Worst case, it was going to cost me £320 and that was only if it was a wheel sensor problem.
Being a tight arse, I bought a pair off a German seller on Ebay for £20.50 carriage paid, with a 3yr guarantee too.
I changed the offside front first, went for a test drive and both lights went off within the first 50yds.
Haven't had a problem since, so my repair only cost me £20.50 and I still have a spare sensor.
Hope yours turns out to be just as easy.