Take it from a machinist; doing your own threads is a bitch. It’s a bit of a hassle even when you stick with standard threads, and “custom threads” are a dick move that often makes things irreparable if they ever wear out or break, or (at best) makes you make people to buy from your competitors in order to avoid the hassles. So you will want to stick with a standard-sized metric thread unless you just want to be difficult.
For threads, the second number is the pitch. SAE threads measure pitch in threads per inch while metric threads measure in millimeters per revolution. An M1×0.2 thread will use a screw that is a hair under 1mm in diameter and will get 15mm travel if you just turn it 75 times (0.2mm/rev * 75 revs = 15.0mm). Conversely, the ball screws in many CNC machines are almost as thick as a grown man’s wrist (40mm is common), yet can get precision to within 0.01mm with ease due to feedback sensors and accurate control of the drive motors that allow for fractions of a revolution.
As for optimal, what does that mean? What defines “optimal” in the context of your intended use? Does it have to handle huge loads such as moving the multi-ton gantry that some types of milling machines use for an X-axis, or are we talking something tiny and petite here?
Optimal diameter depends on the stress/load you plan the actuator to endure; a car jack needs a thicker screw than the ejector tray of a Bluray drive. Optimal thread size depends on the diameter (each diameter has 2–3 “standard” pitches; often a course and fine), the method of rotating the screw, and the force amplification required.