The easy way, but which can get kind of wordy if you have a lot of conditions:
#if( $lead.LeadScore.isEmpty() )
#set( $lead.LeadScore = "0" )
#end
#set( $LeadScore = $convert.toInteger($lead.LeadScore) )
#if( $LeadScore >= 500 && $LeadScore < 600 )
is between 500 and 599 inclusive
#elseif( $LeadScore >= 600 && $LeadScore < 700)
is between 600 and 699 inclusive
#elseif( $LeadScore >= 700 && $LeadScore < 1000)
is between 700 and 999 inclusive
#end
The more robust way, which is easier to maintain with lots of conditions. In this case I'm assigning another variable a friendly name like "low" or "high" which you can use to decide output:
#if( $lead.LeadScore.isEmpty() )
#set( $lead.LeadScore = "0" )
#end
#set( $LeadScore = $convert.toInteger($lead.LeadScore) )
#set( $absmin = $field.in($LeadScore.class).MIN_VALUE )
#set( $absmax = $field.in($LeadScore.class).MAX_VALUE )
#set( $ScoreRanges = [
{ "name" : "negative", "minmax" : [$absmin,0] },
{ "name" : "x-low", "minmax" : [0,500] },
{ "name" : "low", "minmax" : [500,600] },
{ "name" : "med", "minmax" : [600,700] },
{ "name" : "high", "minmax" : [700,1000]},
{ "name" : "x-high", "minmax" : [1000,$absmax] }
])
#foreach( $range in $ScoreRanges )
#if( $LeadScore >= $range.minmax[0] && $LeadScore < $range.minmax[1] )
#set( $LeadRange = $range.name )
#break
#end
#end
Your named range is ${LeadRange}