Are police allowed to do things they would not have normally been able to do if not for the situation (e.g. tackling the attempter to prevent him from falling)?
Yes.
If so, how are they allowed to prevent a legal action?
While this is a matter of state law, generally speaking, the authority is provided either by statute or by common law case precedents in each state. Sometimes this authority is provided in the general provisions of the criminal code, sometimes this authority is provided in a criminal procedure or law enforcement professional code, and sometimes this is provided in provisions pertaining to mental health proceedings.
For example, in Colorado, Section 18-1-703(1)(d) of the Colorado Revised Statutes states:
(1) The use of physical force upon another person that would otherwise constitute an offense is justifiable and not criminal under any of the following circumstances:
(d) A person acting under a reasonable belief that another person is about to commit suicide or to inflict serious bodily injury upon himself may use reasonable and appropriate physical force upon that person to the extent that it is reasonably necessary to thwart the result.
Also, the fact that suicide is not a crime, and the fact that someone can be punished punitively for attempting suicide, does not mean that attempting suicide is without legal consequences.
In general, every state authorizes a 72 hour involuntary mental health commitment, on the say so of any of a long list of mental health officials without a prior court order, and authorizes further involuntary commitment with a court order, if someone is a danger to themselves or others.
Not all things that are illegal or legally regulated are crimes.