How can I replace a custom token?
Try this:

$node = node_load($context['data']['node']-&gt;nid);
token_replace("[node:story-page-number]", array('node' =&gt; $node));


If $context['data']['node'] is already a node, then you may skip the node_load() call, and simply assign $node = $context['data']['node'];

Edit: Sorry, I didn't try your example in code.  You need to include the token type in your token names. In mymodule_tokens(), check to be sure that $type is 'node', and then look up $node from $data['node']. Note that you are using the Drupal 6 hook_token_values(); you should use the D7 hook_tokens().  Use the implementation of node_tokens() as a guide.

References


hook_tokens()
token_replace()