I don’t have much experience in Glacier, but the Gunsight Pass Trail is awesome; I only had time for a quick out and back though. I wish I could have gone all the way through. Not sure the exact mileage from Lake McDonald to Saint Mary Lake. From two Medicine lake, Pitamakan Pass to Dawson Pass is a good loop. Although it’s not 30 miles you could add some more trails to it. The amount of miles you want to do really depend on the trail you’re on. A lot of them gain/lose thousands of feet in elevation.
From Many Glacier, Cracker Lake might be a good option for your last night in the backcountry. It’s less than 10 miles to the campsite; there are some photos on GoogleEarth you could check out.
Have plenty of options handy. If you’re not going to reserve campsites ahead of time it might be difficult to get exactly what you want, especially in August. Last year seemed pretty crowded; maybe it being the centennial year and all, but who the hell knows. Have fun!