The problem there is this: By ordering Apple to develop new software to allow the FBI to continue trying password combinations, the Court is ordering Apple - a third party - to become part of a prosecutorial investigation.
By the same token, forcing Apple to do the data retrieval in-house also means that a third party is being forced by court order to become party to a prosecutorial investigation.
In either scenario, Apple would still have to spend its own resources to create or alter software.
My expertise is not in criminal justice, but I'm not so sure there is actual authority to force a non-governmental, non-law enforcement, publicly-traded company to assist in an investigation by creating new investigative tools or techniques.
That said, if they refuse to assist, I wonder if the next move would be to slap Apple with a charge of impeding an investigation.