In Exodus 20:7 we read (what is commonly considered to be) the third Commandment:
You shall not take the name of the Lord your God in vain, for the Lord will not leave him unpunished who takes His name in vain.
I have heard that this means speaking the name of God in a manner that does not preserve the reverence and respect due to Him and His name.
I have also heard that this means taking the name of the Lord in an empty fashion, where "taking His name" signifies an identifying of oneself with Him, similar to a woman taking a man's name in marriage to signify her union to him. In this case it would mean identifying oneself as one of "His people" (e.g. an "Israelite" or a "Christian") though it be in vain (i.e. no heart / action / devotion behind the association.)
Both sound very convincing to me, having never investigated the Hebrew of this passage. Are both possibilities allowed for in the wording of the Hebrew?
I am specifically looking for guidance from a historical-grammatical perspective. Are there any clues in the Hebrew of this text and/or similar Hebrew wordings in the Old Testament that might shed some light on this debate?