Lino, I can't answer the question re the roadside drug test, (a Policeman may be better positioned to do this), but I can definitively advise you and any swagger interested that the reason the chemist asks for your drivers licence with pseudo products is to make sure you're not a too regular purchaser who could be potentially turning the base product into speed or methamphetamine party drugs. Police can come into the Pharmacy and request to see the records of regular purchasers, or a Pharmacist may report regular purchasers to the Police under agreed circumstances. Usually asking for ID stops the regular purchasers anyway.
It's not a law persay, but a protocol agreed to between the national Chemists body and Police in each state designed to stop the mass production of party drugs in this case.
There have been several Pharmacists around Australia lose their practice licence for not abiding by the agreed rules and or selling these products in bulk quantities in an effort to make $$'s the wrong way.
99.9% of Chemists are very community health focussed, but as with any profession there's always 0.1% misguided fools. These protocols are designed to stop them.
There was also an incident several years ago whereby a pharmacy wholesale warehouse employee happened to lose a pallet of pseudo product, was caught and sent away for a spell.
It is so tightly monitored these days that fools looking to make a quid in this area will get caught.