性的な意味はなく、ぬいぐるみやおもちゃの聴診器を使う、お医者さんごっこ遊びです。「上手に」というのは、患者らしくふるまうという意味です。He took a role of a patient while he was playing doctors. He pretended to be a patient just like a real patient! は自然な英語ですか?
He played the role of a patient while playing doctor with his friend.
take the role を使って言っても間違いではないですが、ちょっと固い言い方になってしまいます。もっと自然に言うなら、play the role を使うと良いでしょう。
例:
He played the role of a patient while playing doctor with his friend.
「彼は友達とお医者さんゴッコで患者役をした。」
play the role of a patient で「患者役をする」
play doctor で「お医者さんゴッコ」
He and his friend played doctor and he was the patient. I think he played his roll very well.
「息子と友達はお医者さんゴッコをして、息子は患者になった。彼は患者の役を上手に演じていたと思う。」
play one's roll very well で「役をうまく演じる」
ご参考まで!