You'll need to tweak this code a bit but it should get you going in the right direction. What this is doing is modifying the sql query used to pull the posts.
Before your query_posts(); add the following code:
function selectSticky( $sql ){
global $sticky_posts, $wpdb;
$sticky_posts = get_option( 'sticky_posts' );
$sticky_posts = implode( ', ', $sticky_posts );
return "IF( {$wpdb->posts}.ID IN ( $sticky_posts ), 2, 1 ) as sticky, ".$sql;
}
function whereSticky( $sql ){
global $sticky_posts, $wpdb;
$sql .= " OR {$wpdb->posts}.ID IN ( $sticky_posts )";
return $sql;
}
function orderSticky( $sql ){
$sql = "sticky DESC, ".$sql;
return $sql;
}
// just for checking sql, you can remove this once everything works
function requestSticky( $sql ){
echo $sql."<br/><br/>";
return $sql;
}
add_action( 'posts_fields', 'selectSticky' );
add_action( 'posts_where', 'whereSticky' );
add_action( 'posts_orderby', 'orderSticky' );
add_action( 'posts_request', 'requestSticky' );