Because of the size of the image in InDesign. Scaling will affect the ppi and not alter the pixel dimensions. Because of this process unless you are planning on printing at a specific physical size at 100%, then don't worry so much about the ppi, as the ppi will be changed.
Keep in mind that the ppi is a metadata value and has no effect on the image it self, it only determines what size it will be printed at.
Knowing this, you have two choices, 1) you can set the ppi in photoshop then make sure the image is 100% in InDesign or 2) Don't bother with the ppi in Photoshop and just scale the image in InDesign.
Whether or not the image is blurry, pixelated or other not wanted side-effect will depend on the pixel dimension.
What that value is will depend on the physical size you want to print at. The smaller the image, the lower the pixel dimension can be.
All that said, the easiest way to remember is to just use the formula.
inches x ppi = pixels
To recap - Because scaling in InDesign does not affect the pixels, when scaling in inches, the ppi value must change.
That's not even closely related to what I was asking. Read the question. I'm asking why the action/script didn't work correctly.
I took it because of how it imported into Indesigner. As for the script throwing errors, that could be anything, including not having permission to write in that folder.