This phase I trial tests the safety, side effects, best dose and how well arsenic trioxide works to prevent relapse in patients undergoing allogenic stem cell transplantation for acute myeloid leukemia (AML) or myelodysplastic syndrome (MDS). Chemotherapy drugs, such as arsenic trioxide, work in different ways to stop the growth of cancer cells, either by killing the cells, by stopping them from dividing, or by stopping them from spreading. Giving arsenic trioxide may be safe, tolerable and/or effective in preventing relapse in patients undergoing allogenic stem cell transplant for AML or MDS.