Is it safe to create a 240V dryer power cord from parts if you need one longer than the standard 6' length available in stores?

Yes this is safe. But you need to purchase the right parts to make this work. I would recommend talking with the electrical department at Home Depot or Menards for something like this. The easiest and safest way will be to buy some stranded 10/3 wire (be warned, they charge an arm and a leg for this) and a junction box. Join the longest cord you can get to the 10/3 in the junction box using standard wiring devices. Then run the 10/3 to the dryer.