...the court ruling was for him to sell the matrimonial home (3room HDB flat) on the open market..
Your friend has no choice as to follow the court rule, to sell away the flat. He will be eligible to buy resale flat. He cannot repurchase the flat as the court rule said to sell the flat. As others said, get a agent to assist him.