First of all, as BGRM mentions, they aren't keeping Muscala, so it's really just $15 million (Plus whatever they are paying TLC), so essentially, they are paying $6 million more than if they had just waived and stretched Melo, but getting back a backup point guard in return. (Would I pay $6 million a year for Schroeder? No, but I'm not an Oklahoma oil billionaire).
Maybe more importantly, the "stretched" money for Anthony could not have been moved off the cap via trade, whereas in theory the Thunder could move Schroeder at some point, saving even more money in the future. There's not really any market for him right now, but if a contender's Point Guard went down during the season, they could potentially deal him for an expiring contract, and go into the 19-20' season with zero salary obligation compared to the $9 million of dead money on the books for Melo.
All in all, it sounds like a decent gamble.