I don't understand module_load_include() I believe it is meant to be used as follows, in loading a module include file into the calling scope:

function mymodule1_myfunction1(){
    ...
    module_load_include($type, $module, $name);
    ...
}


But looking at the code of module_load_include():

function module_load_include($type, $module, $name = NULL) {
  static $files = array();

  if (!isset($name)) {
    $name = $module;
  }

  $key = $type . ':' . $module . ':' . $name;
  if (isset($files[$key])) {
    return $files[$key];
  }

  if (function_exists('drupal_get_path')) {
    $file = DRUPAL_ROOT . '/' . drupal_get_path('module', $module) . "/$name.$type";
    if (is_file($file)) {
      require_once $file;
      $files[$key] = $file;
      return $file;
    }
    else {
      $files[$key] = FALSE;
    }
  }
  return FALSE;
}


We see that

require_once $file

is used to load $file into the scope of module_load_include(),  not  mymodule1_myfunction1() so $file is not available to mymodule1_myfunction1(). Is this not how module_load_include() is meant to be used?
We see that require_once $file is used to load $file into the scope of module_load_include()


Not quite. This is from the include docs (identical to require in this respect)


  When a file is included, the code it contains inherits the variable scope of the line on which the include occurs. Any variables available at that line in the calling file will be available within the called file, from that point forward. However, all functions and classes defined in the included file have the global scope.


Emphasis mine.

So functions/classes defined in an a file sourced with include/require will be available to all subsequent code. Or more specifically, all functions/class defined in the file you include via module_load_include will be available in mymodule1_myfunction1() after the call.