I guess the trick is that you have to set things up for the coin to immediately trade as soon as it is mined
That's exactly how it works. The pool integrates with an exchange (or possibly several) and the profitability of each altcoin is calculated based on the prices on that exchange. Mined coins are auto-deposited at the exchange, and the exchange automatically sells them for BTC.
It sounds awesome. But there are a lot of non-obvious problems with the above sequence of events. The major ones being fees, delays, and non-liquidity on the exchange. Unless there is a huge spike or dip in price, any advantage you get by switching from a slightly less profitable coin to a slightly more profitable one will be eaten up by those problems.
It's also possible to do something similar in the mining software itself using cgwatcher and cgminer or bfgminer without trusting the pool to do the switching for you. It didn't look like a lot of fun to set up, so I didn't bother.