You are making a major mistake. You are writing the JSL, rather than letting JMP write the JSL for you. If you create the graph interactively, just the way you want it, you can then request to have the JSL saved that will recreate the graph just the way you specified.
That is, if you have the graph
txnelson_5-1656269571687.png
which has everything, except for the Legend specification, you can go to the red triangle and select Legend Settings
txnelson_2-1656269051282.png
and then in the dialog window that pops up, you can change the position of the legend 1.
txnelson_3-1656269224121.png
then go to the red triangle and select save script and it saves the script with the commands required to reproduce it
Graph Builder(
Size( 779, 677 ),
Show Control Panel( 0 ),
Variables( X( :X ), Y( :Y ), Wrap( :Items ), Color( :Legends ) ),
Elements( Points( X, Y, Legend( 8 ) ) ),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
8,
Properties( 0, {Line Color( 36 )}, Item ID( "Legend 1", 1 ) ),
Properties( 1, {Line Color( -15343117 )}, Item ID( "Legend 2", 1 ) ),
Properties( 2, {Line Color( -15343117 )}, Item ID( "Legend 3", 1 ) ),
Properties( 3, {Line Color( -15343117 )}, Item ID( "Legend 4", 1 ) ),
Properties( 4, {Line Color( -15343117 )}, Item ID( "Legend 5", 1 ) ),
Properties( 5, {Line Color( -15343117 )}, Item ID( "Legend 6", 1 ) ),
Properties( 6, {Line Color( 40 )}, Item ID( "Legend 7", 1 ) ),
Properties( 7, {Line Color( 24 )}, Item ID( "Legend 8", 1 ) )
)}
),
Dispatch(
{},
"400",
LegendBox,
{Legend Position( {8, [6, 0, 1, 2, 3, 4, 5, 7]} )}
)
)
);
txnelson_4-1656269479315.png
I find the Scripting Index to be the best reference for all of the functions and platform syntax. It has all of the messages that can be sent to a platform and functions, along with live examples.
Jim