Hi and welcome
What engine and mileage do you have, that would be good for starters?
Does it do it more when engine is cold or hot?
I had a similar issue with rough and uneven idling on my manual 3.0si though, however mine kept tripping an engine management light at odd intervals, there was also an error code recorded as well. My fault was intermittent and only effected the idle on occasions which was a real pain. Do you have a code reader to check if yours has any error codes recorded?
This was my thread which detailed my 6 month journey http://www.z4-forum.com/forum/viewtopic.php?f=3&t=46501
Hopefully another more mechanically minded member will be able to offer you some further advice.