Most important is to understand the code.
Then you know where to put.

Code:
MATERIAL* mtl_toon = {
	effect = "toon.fx";
}

...is a definition.
It is outside of a function.

Code:
  my.material = mtl_toon;

...is an assignment.
It's part of the entities action (inside the action/function)