Complex sorting Views
I suggest you to make use of the following hook:

function YOURCUSTOMMODULENAME_views_post_execute(&amp;$view){

    switch ($view-&gt;name){

 case "YOURVIEWMACHINENAME";

    // Get the result of the view in a array      
    $data = $view-&gt;result;

    // your custom code to add / remove instances after the view was executed    


    // Set the result of the custom code back into the view
    $view-&gt;result = $data;
    break;

  }
}


Your custom code would be something like 
If there are less then 5 elements and more then 1 elements in the data array add new elements to the data array coming from another view.

To execute a view in code u can use something like this:

  $reflang = views_get_view("NAMOFYOURMACHINENAMEVIEW");
  $reflang-&gt;set_display("NAMEOFYOURDISPLAY");
  $reflang-&gt;set_arguments(ARGUMENTSFORTHEVIEW);
  $reflang-&gt;pre_execute();
  $reflang-&gt;execute();

  foreach ($reflang-&gt;result as $row =&gt; $rowinfo) {
    // add this to the data array
  }


Hopefully this helps you to solve the problem.