In Biblical Hebrew the infinitive absolute functions as an "absolute complement" or adverb to indicate intensity. So in Gen 2:17 the infinitive מֹות modifies the imperfect verb תָּמוּת, and of course the context indicates the future. That is, literally that day Adam "...was surely to die..."
Another example of this verb/adverb arrangement are the Israelites, who sinned against the Lord and subsequently died in the wilderness...
Numbers 26:65 (NASB)
65 For the Lord had said of them, “They shall surely die in the wilderness.” And not a man was left of them, except Caleb the son of Jephunneh and Joshua the son of Nun.
The same absolute infinitive with the same verb occurs here. That is, over a period of 40 years, all of the adult Israelites who had escaped Egypt died in the wilderness with the exception of Caleb and Joshua. The Lord declared "the death penalty" on these people because of the several tests in the wilderness to which they "grumbled" against the Lord and Moses over an extended period of time.
However, in Torah there are instances where this infinitive absolute (מֹות) modifies the same Hebrew verb to die in the context of the penalty for violating the commandment of the Lord. In the following instances where the command of the Lord occurs (as in the case of Gen 2:17), the penalty of death appears to occur on the same day as the sin: Ex 19:12; Gen 20:7; and Lev 24:16. In regards to this last verse (Le 24:16), the one instance in Torah where public execution actually occurred in the violation of the explicit commandment of the Mosaic Law, the punishment appears to have been meted out within a matter of hours (Lev 24:9-16). Thus, the "surely will die" conveyed immediacy when explicit commands of the Lord were concerned.
Translators have observed this distinction. For example, in the NASB the phrase "shall surely be put to death" is the translation of the infinitive absolute when defiance to the Lord is in view, but where man is expected to execute the judgment (such as Ex 21:12 concerning murder). However, the same translators use "you will surely die" when it is the Lord in view, and who is the agent of his own judgment--thus there is no doubt as to the immediacy of judgment. In other words, the translators do not render the translation "shall surely be put to death" when it is the Lord in view and who is enforcing his own direct judgment; instead, translators render the unequivocal "(that person) shall surely die." The case of Abimelech, who sought to take Abraham's wife Sarah, provides an excellent example.
Genesis 20:3 (NASB)
3 But God came to Abimelech in a dream of the night, and said to him, “Behold, you are a dead man because of the woman whom you have taken, for she is married.”
Genesis 20:6-7 (NASB)
6 Then God said to him in the dream, “Yes, I know that in the integrity of your heart you have done this, and I also kept you from sinning against Me; therefore I did not let you touch her. 7 Now therefore, restore the man’s wife, for he is a prophet, and he will pray for you and you will live. But if you do not restore her, know that you shall surely die, you and all who are yours.”
Here the infinitive absolute occurs with the same Hebrew verb, which the translators render "shall surely die." Abimelech's death was declared in the past tense (v.3), and was therefore viewed as imminent pending his immediate repentance, because the Lord was the direct ("immediate") agent of judgment. In other words, Abimelech had sensed imminent mortal danger because the Lord was enforcing the command.
Interestingly enough, Abimelech (yet a different king) uses the same infinitive absolute construct (with the same Hebrew verb) to indicate that if anyone touches Rebekah (wife of Isaac), they will be put to death at the commandment of Abimelech (and not the Lord).
Genesis 26:11 (NASB)
11 So Abimelech charged all the people, saying, “He who touches this man or his wife shall surely be put to death.”
The Lord is not in view here, but the agent of enforcement now is man, and so the translators render the text "shall surely be put to death." The parallels are striking because both kings in Genesis are named "Abimelech" and both women concerned are the wives of the forefathers (Abraham and Isaac). In the former case, the Lord is in view who enforces the judgment (thus the translation, "shall surely die" = no delay by the Lord); and in the latter case, it is man who is in view. Thus the translation, "shall surely be put to death" (and so delay or postponement was possible by man, but not always as was seen in Lev 24:9-16, already noted above). The following chart illustrates the general guideline used by the NASB in its translation of the Hebrew Bible.
In the case of the Lord, enforcement was assured with immediate certainty; in the case of man, enforcement was not always assured, nor was always certain.
In summary, Adam of course physically lived more than 900 years after sinning in the Garden. Did his human Spirit die on that day when he disobeyed the Lord (i.e., did his spiritual death include termination of access to the Tree of Life in Gen 3:22-23)? If he did not die spiritually, then the use of the infinitive absolute (מֹות) in Gen 2:17 would be the ONLY instance where "death" would not appear to occur on the same day as the penalty for violating an explicit and direct commandment from the Lord and by the Lord. In other words, wherever violations of explicit commandments from the Lord and by the Lord are concerned (that is, the Lord is in view as the agent of enforcement), then the sentence and execution of death in the Torah were expected to be immediate: thus the tendency of translators to render the Hebrew not to read, Shall surely be put to death, but that (the person) shall surely die.