In normal Prolog the way is to use expand_term/2. It is a bit hard to guarantee the safety thereof. SWI-Prolog also has dcg_translate_rule/2 that is eventually used for DCG rules. That failed to pass the sandbox as well. Added to the set of safe predicates. Will be activated on the next Prolog update for SWISH.
No. Term expansion produces both a the clause and a directive that registers the predicate as a DCG non-terminal. That is just a flag that is accessible through predicate_property/2. Not much is done with this flag. It can be used to improve reporting, code analysis, etc.
In general one must expect expand_term/2 to either produce a single term or a list. The individual terms are either clauses or directives.