There is no rigorously defined doctrine of the trinity in the Christian scriptures. The Holy Spirit, and the righteous man being called a 'son of God', are present in Judaism. They are not, however, seen as separate persons within a triune godhead. The doctrine of the trinity was a concept which evolved over time based, in part, upon theological reflection on the sort of verses to which you allude.