Welcome to the RTA forum!
Your idea is close to working, but you really need on more day. Its a days drive between all the places you've listed, except Yellowstone to Davis is solid 2 days. So that means you need 6 days on the road, which only leaves you one for exploration of the Badland/Black Hills or Yellowstone.