The first phrase of verses 31 and 32 are the same because the rest of verse 31 is an historical aside. Alma wants to speak of the God-delivered commandments, but first clarifies the situation into which they are given. Alma recaps the events of the Garden of Eden.
The first part of the aside discusses the partaking of the fruit. Alma's take on the theological problem of Adam's violation of the command to not eat of the fruit is an interesting one. Alma concedes that it was a commandment. He calls it part of "the first commandments." What is interesting is that he limits the scope of those commandments. He says that they pertained "to things which were temporal."
For Alma, the eating of the fruit was a temporal commandment, and had a temporal result. Of course we should remember that when Alma has been using the word "temporal" it has been in the context of the physical, and not the time-delimited. That is, for Alma, "temporal" is the word he has used for physical death (the "temporal death"). Thus when he says that this is a "temporal" commandment, he means that it pertained to the life of the body. The eating of the fruit caused death. It created the temporal death for which the Savior atoned.
The second part of the condition of the Fall is the susceptibility to sin. Alma does not indicate that Adam has sinned, but rather than he now might sin. Alma says that after the imposition of the temporal death, the next effect of the Fall was that Adam and Eve became "as Gods, knowing good from evil." Of course this is precisely what Genesis tells us, but for Alma it provides the clear indication of how the spiritual death began. It was not imposed, but rather came as a result of this new gift to man.
The "becoming as Gods" was the process of "knowing good from evil." Clearly, Alma suggests that this was not possible for Adam and Eve prior to the eating of the fruit. They only now know the difference between good and evil. Was this sin?
For Alma, the answer is a resounding no. What this knowledge did was to place Adam and Eve "in a state to act…whether to do evil or to do good." In this definition, Alma makes sure that we understand that not only may Adam and Eve now act upon this information about good and evil, but that they do so "according to their wills and pleasures." In other words, Adam and Eve may now act upon their knowledge of the difference between good and evil, and they do so with their own agency. The act of eating did not impose sin, but rather imposed a condition which allowed Adam and Eve to chose sin, just as it allowed them to chose righteousness.
If Alma were to weigh in on modern debates about the sin in the Garden, and whether or not Adam sinned when he ate the fruit, Alma would say that the question has no application. Since Adam and Eve ate of the fruit before they knew good from evil, before they were accountable for making choices according to their agency, it would be a moot point. By his definition, sin could only occur after the partaking of the fruit. What the fruit did was institute the temporal death, because not eating the fruit was a temporal commandment. Eating the fruit opened the possibility of spiritual life through agency, but it also opened the possibility of sin through our willful violation of the commandments of God. Adam may have brought death upon us all, but we bring the second death upon ourselves through our own exercise of agency.