Ketamine was first developed in 1962. It is on the World Health Organization's List of Essential Medicines, the most important medication needed in a basic health system. It is legally sold under a very wide variety of brand names, including Ketalar.
If the crime you commit (generally just first degree murder) is in a state that does not have the death penalty then the only way you can be executed is if you are tried in a federal court as opposed to a state court.
Mental health conditions should be taken into account during all phases of a death penalty case. This includes the execution itself. The U.S. Supreme Court is on record that no legitimate government purpose is served by the execution of someone who is not competent at the time of the execution.