Thanks for the help Meng Zhiqun.
Because I am the end user, and I have done error checking elsewhere in the script, I trimmed it down to this:
var compVideo = app.project.item(3); // the video composition – which because of the naming structure will be the 3rd composition
var vidL = compVideo.layer(4); // the actual video layer in the video composition – will be layer 4
var addTime = 2;
function freezeFrame(vidL){
item.startTime = 0;
compVideo.duration = item.outPoint+ addTime;
item.timeRemapEnabled = true;
item.outPoint = item.outPoint+ addTime;
}
Apologies for the late response.