LD1
What you need to do (which I assume you know already) is find out in writing the dealers warranty on service work performed on used vehicles vs service work performed on vehicles brought in for service.
If the service work performed on used cars sold exceeds the warranty work listed for the used car "as is with written warranty" I think you have a leg to stand on.
Although one might have a reasonable expectation for service work performed to last a significant amount of time, unless it's in writing, the only way you're going to find out is if the service work performed fails and you take it back (which you did and the dealer told you it was out of warranty per the written warranty).
Ultimately if the car was sold with a 30 day warranty, no matter what work they perform on it, my line of thinking is that anything that goes wrong with the vehicle after 30 days now exceeds the warranty and you're out of luck because your only expectation for any warranty work to last more than 30 days is to have it writing.
I know in the residential HVAC industry in NC, a licensed contractor is obligated to stand behind his new installation (NOT service work on a service call) for 1 year, which includes parts and labor, but have no clue how the auto industry is regulated when it comes to used cars.
A 30 day warranty on ANY 20k vehicle should be your first warning sign, even from a dealership.
I would agree that I would expect the dealership to do something to help (and in their eyes, they may think they are already doing so by cutting their labor in half for the repair), but again, from everything from the story you've told, I don't believe they have done anything illegal.