Query Cost Difference / Call Overhead

I have been wondering if there is any difference between these two methods...

  1. Define actions in a query, with a nice name, and apply it like this:

  2. Put the code directly into the code box like this:

Do they "cost" the same, or does doing #1 incur one extra call/request? Are there any optimizations to one way or the other?