//test if number of pages is odd or even and exclude last from count if odd
//define path to pdf that will be inserted
//loop through pages and insert pdf after every even page
What happens when you try the code?
I haven't examined your code in detail, but I can tell it suffers from a problem common to "insert after/delete every Nth item" programs. The problem is that the action of inserting the page(s) will affect the pages in the document. So let's suppose the original document has pages A B C D E F ... and the new one has pages Z Y X W V U ...
The easy way to code this will go
A B C D E F ...
A B Z Y X W V U ...C D E F ...
A B Z Y Z Y X W V U ...X W V U ... C D E F ...
A B Z Y Z Y Z Y X W V U ...X W V U ...X W V U ... C D E F ...
and so on. To overcome this the easy way is to START AT THE END NOT THE BEGINNING.