How to alter a function in a contributed module?
As far as I know, you can only alter the functionality the module exposes using hooks defined by that module, and you cannot alter just any function defined in the module. For instance, shs_json_term_get_children is just a callback, and you cannot alter it.

The SHS module defines several hooks that are listed in the shs.api.php file. For instance, there is a hook called hook_shs_term_get_children_alter, that allows you to modify the list of terms displayed to the user: http://cgit.drupalcode.org/shs/tree/shs.api.php?h=7.x-1.x#n73

/**
 * Alter the list of terms within a level of the term hierarchy.
 *
 * @param array $terms
 *   List of terms displayed to the user (single hierarchy level).
 * @param array $alter_options
 *   - vid: ID of vocabulary or field name
 *   - parent: ID of parent term
 *   - settings: Additional settings (for example "language", etc.,)
 */
function hook_shs_term_get_children_alter(&amp;$terms, &amp;$alter_options) {
}


In your module, you would need to implement that hook like that:

function YOURMODULENAME_shs_term_get_children_alter(&amp;$terms, &amp;$alter_options) {
  // Your code here.
}