This phase II trial is studying how well giving O6-benzylguanine together with temozolomide works in treating young patients with recurrent or progressive gliomas or brain stem tumors. Drugs used in chemotherapy, such as O6-benzylguanine and temozolomide , work in different ways to stop the growth of tumor cells, either by killing the cells or by stopping them from dividing. O6-benzylguanine may help temozolomide work better by making tumor cells more sensitive to the drug. Giving more than one drug (combination chemotherapy) may kill more tumor cells.