You need to shut the gas off either at the main or if there is a shutoff at the pipe near the dryer, you can shut it off there. You need not worry too much because a wrench is all you need to disconnect the two pipes. You need to know that gas threads are not always the same as other threaded pipes. Gas line threads sometimes go in the opposite direction. To the right to loosen and to the left to tighten. Don't assume that this is what was done however as threads are usually made by a person installing the pipes by using a threading machine. You need to figure out which way they are going. If the person making the threads made them backyards, you would have to reverse what they did. This is why it's important to shut the gas off so that if you break something (unlikely) you won't get a gas leak.
You would be much better off cutting the pipe if it's jammed at the thread. Do not use a power tool as this can ignite the remaining gas in the line. Use a hand held hacksaw. You will need to go to the nearest joint or elbow and turn the pipe that you just cut off of the flex pipe (or rigid pipe) and unscrew it with a wrench. Nudge the wrench back and forth to see which direction the pipe to will move because if you make a forceful turn with the wrench you will end up with the same problem you had at the dryer. You could end up tightening to the point where it won't come off. Figure out what you need in length's and elbow's in order to reach the dryer. Put blue gas pipe joint compound in the thread and tighten all joints and elbows as much as possible. You can install elbows and various lengths of pipe to accommodate your dryer. Pipes can be purchased in different lengths. Once you're done turn the gas back on and check for leaks. Use soapy water so that you can see if it makes bubbles. Tighten until the bubbles are gone.
Hope I Helped :)
Building Inspector
City building inspector 14 years. Contractor 30 years. RI Dept. of Health Certified.