Yes. The most straightforward way is to customize the scale once interactively, and then save the script and use that as a template. The script will include an embedded "SendToReport" part, but that can be separated from the initial script and executed repeatedly as you adjust the values.
For instance, the saved customized script might be:
Graph Builder(
Size( 519, 447 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :sex ), Color( :height ) ),
Elements( Heatmap( X, Y, Legend( 5 ) ) ),
SendToReport(
Dispatch( {}, "400", ScaleBox,
{Legend Model( 5,
Properties( 0,
{gradient( {Scale Values( [50 65 75] ), Width( 12 )} )}) ))}
))
);
which can be written separately as:
gb = Graph Builder(
Size( 519, 447 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :sex ), Color( :height ) ),
Elements( Heatmap( X, Y, Legend( 5 ) ) )
);
gb<<SendToReport( Dispatch( {}, "400", ScaleBox,
{Legend Model( 5,
Properties( 0, {gradient( {Scale Values( [50 65 75] )} )} ) )})
);
The number 5 in this case is an identifier for the legend, in case of multiple element, each having its own legend.