To accomplish the task, follow these three steps:
// Adjust the path to be open
//lineSubPathArray.closed = true;
lineSubPathArray.closed = false;
Disable the selection code
// // =======================================================
// var idsetd = charIDToTypeID( "setd" );
// var desc100 = new ActionDescriptor();
// var idnull = charIDToTypeID( "null" );
// var ref24 = new ActionReference();
// var idChnl = charIDToTypeID( "Chnl" );
// var idfsel = charIDToTypeID( "fsel" );
// ref24.putProperty( idChnl, idfsel );
// desc100.putReference( idnull, ref24 );
// var idT = charIDToTypeID( "T " );
// var ref25 = new ActionReference();
// var idPath = charIDToTypeID( "Path" );
// var idOrdn = charIDToTypeID( "Ordn" );
// var idTrgt = charIDToTypeID( "Trgt" );
// ref25.putEnumerated( idPath, idOrdn, idTrgt );
// desc100.putReference( idT, ref25 );
// var idVrsn = charIDToTypeID( "Vrsn" );
// desc100.putInteger( idVrsn, 1 );
// var idvectorMaskParams = stringIDToTypeID( "vectorMaskParams" );
// desc100.putBoolean( idvectorMaskParams, true );
// executeAction( idsetd, desc100, DialogModes.NO );
substitute the stroke function with
function stroke_line()
{
// =======================================================
var idStrk = charIDToTypeID( "Strk" );
var desc9847 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref2350 = new ActionReference();
var idPath = charIDToTypeID( "Path" );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref2350.putEnumerated( idPath, idOrdn, idTrgt );
desc9847.putReference( idnull, ref2350 );
var idUsng = charIDToTypeID( "Usng" );
var idPbTl = charIDToTypeID( "PbTl" );
desc9847.putClass( idUsng, idPbTl );
executeAction( idStrk, desc9847, DialogModes.NO );
}