Page templates in subdirectories and auto generator

Instead of having a page template for all of them, have a single page template and use get_template_part to pull in the parts unique to each page.

So instead of:

update_post_meta($new_page_id, '_wp_page_template', $page_filename);

You’d have:

update_post_meta( $new_page_id, '_wp_page_template', 'newpagetemplate.php' );
update_post_meta( $new_page_id, 'sagive_page_type', $page );

Then inside your new page template:

$type = get_post_meta( get_the_id(), 'sagive_page_type', true );
get_template_part( 'parts/type', $type );

Giving you a parts folder with the files type.php, type-tools.php etc etc

But even more reliable, you suggested these page templates are for showing custom post types. If this is true then you could instead make use of archive.php to do this, and use the custom post type archives. This would simplify your code and allow you to use archive-tools.php etc, and removing the need to create any pages to begin with.