Drive as many as you can of both models so you have a really good idea of which suits your needs. I really don't know too much about the Z4 so wont comment there's plenty of owners here that have / can advise on Z4s,
Z3 though, don't get too hung up on engine size or mileage. Try to find a car that has been owned for a fairly long period by an enthusiast, we tend to spend the time and money (or try) keeping the cars in as best condition as possible. Avoid the seller that has bought a car for one summer or two of fun and now selling, it will likely have been driven hard and had no maintenance unless its obviously a good car that has been loved by a previous owner, though in reality it will probably have been the cheapest one they could find for their needs.
A car that has had suspension / bush work done would be higher on my list. Condition and past maintenance is King, much more important than mileage, age etc. If you like lots of torque then consider a 2.8 they are a great engine, or if you can find one and have reasonably deep pockets a 3.0. The 2.2 is possibly the best all rounder with just a little less BHP than a 2.8 and a reduction in torque (not much I don't think though) and for some reason probably the best exhaust note of them all. (oops that comment could start a row).
Never driven a 2.0 or 1.9 but owners on here rave about the better handling and I've chased a few, they are quick enough for most peoples needs, lets be honest we all spend most of our time tootling around at 50 with the roof down enjoying the scenery do we not?
Unless of course you want a running MOT'd project car and want to spend a year or so fixing it up, in that case the worlds your oyster, tonnes of good cheap fixers out there.
Good luck with the search.