OpenSCAD libraries for threads are slow. Really slow. Like 15-minutes-on-a-good-machine slow if you want more than a few threads on a screw. But, if you are willing to approximate standard threads with a sine wave, you can use the 2d functions and extrude them fairly quickly. A couple minutes can get you a ridiculously smooth thread that works with standard metric fasteners. If you are OK with lowering the resolution it can be seconds.
This is a script library, so it might not make a ton of sense to the uninitiated, but if you go over the code, all will be revealed.
Obviously, the finer the layer height of the print, the closer to reality you get. Depending on your machine and the resolution of your print, you may have to play with the scaling factor. With a 0.1 layer height on a cheap Printrbot Simple, I got amazing threads that were just a bit tight on standard M4 fasteners without altering scale, but at lower resolutions, I needed to alter it slightly.
This has lookup tables swiped from the ISOThread.scad library by Trevor Moseley. Thanks Trevor. If your library is on thingiverse, let me know and I'll set the remix thingie.
I plan to expand this with more screw heads and such.