Calling functions?

I've been programming using traditional methods for a couple years now so it's taking a bit to get use to visual development with Gamesalad and I would like to know if there was a way of making a function (lets say that checks how many enemies are left and decide if it needs to spawn a new one) and being able to call it whenever. It seems like this would be making your own behavior but it doesn't seem like I can do that. Another way I thought of working around this (though this doesn't seem practical) is to spawn an actor that does what I need and destroying it at the end of the behaviors, and spawning it again when I want to use that function. I feel like I'm over complicating this

Comments
Is that what you mean?
Spawn the code block actor when you need it to evaluate some globals. Then have it self destruct when it's done. Don't do this tightly looped. Do this on occasion.
Next you'll tell us you've devised a method for making GameSalad Object Oriented! lol