yep, 6 AWG stranded would have been my choice, with a 50 or 60 A GFCI breaker. As mentioned, replace the wiring in the wall first, it is probably 8 AWG.

since you are pulling wire to the breaker anyway, why not run a dedicated circuit? That way you can put the outlet where it would be convenient, and won't have to hassle with the dryer.