Quite simple, if the flap limit is 20,000 ft, don't exceed it. My Jetstar gear wouldn't retract going from LAS to LAX one day so we stayed at FL200 and maintained max gear extention speed. It took 20 minutes longer but our passengers didn't have to wait for an extensive maintenance delay.