Unfortunately, I think you should skip Glacier. Going To The Sun Road is a 'must' for that park but you'll be there too late. In 2018 it closed Sept 29, 2019 - Sept 25 and 2020 - Oct 9.
https://www.nps.gov/glac/planyourvisit/conditions.htm
Custer to West Yellowstone:
https://www.nps.gov/yell/planyourvisit/index.htm
Average High in Oct. 55 deg
Average Low in Oct. 29 deg
Average Snow in Oct. 4"
The East and West Entrances are open until Nov 8
Custer - I-90 west to Buffalo, Hwy 16 to Worland
20N to Basin then 30 to 14W to Cody
Continue on 14/16/20 into the park and stay in West Yellowstone
490 miles
OR:
I-90 to Bozeman then south on 191 to West Yellowstone - 580 miles
If going to Yellowstone definitely work in Grand Teton Nat'l Park - they're connected and completely different in looks.
https://www.nps.gov/grte/index.htm
For hookups I'd recommend Colter Bay RV in the park itself. You can get there easily from West Yellowstone by driving south through Yellowstone into Grand Teton.
Have you been to the Utah National Parks? Weatherwise, they would be perfect in October.