Thanks for the great feedback. I have it working beautifully.
One last question...
My images vary in width and height. I would like them to be maintain their aspect ratio, while fitting the shortest side (width or height) of the smart object it is replacing (which is a square).
Ideally I'd like the new images to have white space on top and bottom or the sides but not exceed the bounds of the original smart object in the template.
Is this possible? I'm assuming any manipulation would be done right after the "executeAction(idplacedLayerReplaceContents... " command.
Is there a way to do this?