I could not find many examples for the correct use of arguments patterns in pgfkes, but I was able to come up with the following:

\documentclass{standalone}
\usepackage{tikz}

\tikzset{dimen/.style={&lt;-&gt;,&gt;=latex,thin,
  every rectangle node/.style={fill=white,midway}
}}

\tikzset{measuring south/.style args={from #1 to #2 is #3}{
        append after command={
            draw (#1.south west) -- ++(0,-1.0) 
            coordinate (A1) -- ++(0,-10pt)
            (#2.south east) -- ++(0,-1.0) coordinate (A2) -- ++(0,-10pt)
            [dimen] (A1) -- (A2) node {#3}
        }
    }
}

\begin{document}
\begin{tikzpicture}
    \node(a)  [draw,rectangle,text=teal] at (0,0) {here};
    \node(b)  [draw,rectangle,text=olive] at (3,0) {there};
    \path[measuring south=from here to there is far,fill=red];

  \node(x) [draw,rectangle,text=blue] at (0,-2) {Heaven};
  \node(y) [draw,rectangle,text=red] at (3,-2) {Hell};
  \draw (x.south west) -- ++(0,-1.0) 
            coordinate (A1) -- ++(0,-10pt)
            (y.south east) -- ++(0,-1.0) coordinate (A2) -- ++(0,-10pt)
            [dimen] (A1) -- (A2) node {sin};
\end{tikzpicture}
\end{document}


In my output, I would have liked to see the dimension lines from "here" to "there", but these are not visible.




Question: How complex are sprite tasks usually allowed to be?
Answer: Sprites are sentients, not drones.  The task you give them can be as complex as you desire, though excessive conditional statements might not only frustrate your GM, but also result in your sprites performing emergent behavior that you did not intend them to preform (but 'coded' them to) and thus frustrate you as well.  Any task that is complicated in the wrong ways (though if/then/else should be fine in this sense) also runs the risk of confusing your sprite, which is generally not good for the health of your electronics.

N.B.
Sprites are nicer than spirits, in general, and much more forgiving of behavior on the part of technomancers that would constitute "abuse" for summoners.  Nonetheless, it is possible to piss off your sprites (or sprites in general) and angry sprites, while more likely to harrass you than kill you outright, are still not something you want to deal with.  Sprites mildly resent having tasks, and making a massive if/then/else tree so you can keep them indentured for longer than normal is the kind of thing the book seems to indicate will result in them being mad at you.  



Sources:

Sprites are semi-sentient


  Technomancers also have the ability to create semi-autonomous entities out of the fabric of the Matrix, digital creatures that answer to the technomancer’s beck and call.


Tasks are continuous


  A task is a continuous service the technomancer asks, cajoles, or demands from the sprite.


Spirits struggle against magicians who abuse the system to oppress them


  [rules on page 187] This modifier should only be applied when roleplaying calls for it, such as when a magician has been abusive towards her bound spirits or has repeatedly
  put them at risk or forced them to undertake draining tasks like
  Spell Binding. 


Those rules are also applicable to sprites


  Registered sprites may be a drain on the technomancer’s mental
  resources, if the gamemaster chooses, in the same way that bound spirits
  might affect a magician (Bound Spirits, p. 187).


But Sprites are for forgiving and less violent than spirits, generally (compare the following passage to what Free Spirits do when they break free from a binding)


  Free sprites that have been registered against their will are
  not usually vindictive or determined to inflict harm on the operator,
  but will go to any means to counterbalance an “unsatisfied
  equation.” What this may mean in particular cases depends on the
  nature and profile of the free sprite and is left to the gamemaster.
  The sprite can be re-registered through a new registering session,
  as long as the free sprite source code is not altered. This can
  be done an unlimited number of times, but if the operator glitches
  on the re-registering test, the free sprite will get 1 Combat Turn
  to do anything it wants before it is brought back under control.
  If the technomancer character scores a critical glitch on the reregistering,
  he forfeits all remaining owed tasks and the sprite can
  do anything it wants.


All quotes except the last one (from Unwired) are from the Core Rulebook.