I was going to clean up my son's room for him, but he had already done most of it.
I went to tidy up my son's room, but he had almost finished it by himself.
この場合、お母さんが息子の部屋を片付けようとした過去のある時点で、すでに息子は片付けていたわけですから、過去完了形を使って表現することができます。
ーI was going to clean up my son's room for him, but he had already done most of it.
「息子の部屋を片付けてあげようと思ったら、息子がほとんど片付けていた」
ーI went to tidy up my son's room, but he had almost finished it by himself.
「息子の部屋を片付けようとしたら、自分でほとんど片付けていた」
同じ構文を使って別のシチュエーションを見てみましょう。
ーI was going to help my son with his homework, but he had already finished it by himself.
「息子の宿題を手伝ってあげようと思ったら、一人でほとんど終えていた」
ご参考まで!
I was about to go clean my son's room, but I realized that he had already cleaned up almost everything.
ご質問ありがとうございます。
「ほとんど片付けてた」はそのまま英語で「cleaned up almost everything」と言えます。
また、「息子の部屋片付けようかしたら、もうほとんど片付いてた。」と言いたいなら、そうすると、「I was about to go clean my son's room, but I realized that he had already cleaned up almost everything.」になります。
ご参考になれば幸いです。