Is it safe to use a grill to cook when chemically treated wood was burned in it?
Timber is treated using CCA (chromated copper arsenate). It is not safe to burn or eat food cooked over this timber. The main risk with this compound is that the smoke and ash will contain arsenic ("As" is the abbreviation for the element), which is a risk for acute and chronic arsenic poisoning as a result of short or long-term exposures respectively.

A quick search of the literature indicates that the release of copper and chromium is negligible in burning of CCA treated wood, however one paper has this to say:


  These results indicate that the open burning of CCA-treated wood can
  lead to significant air emissions of the more toxic trivalent form of
  As in particle sizes that are most respirable.


I only found one paper on the use of CCA in cooking which showed a weak positive correlation between the use of CCA treated wood and urinary output of copper, chromium and arsenic, so the risk is real!

I believe that these compounds will not accumulate in the grill, so I think if you (wearing respirator and PPE) were to clean the ash and soot out of the grill and dispose of it according to local regulations (check with your council/state/country), as well as washing out the interior of the grill, you should be safe. I would still advise that you get some expert advice on this before using the grill again.