Try something like this,
{{tmpl( homeTeam, { teamRole: 'homeTeam', score: d = getScoreByMatch($data, true) } ) "#scoreTemplate"}}
OR
{{tmpl( roadTeam, { teamRole: 'roadTeam', score: d = ${getScoreByMatch($data, false)} } ) "#scoreTemplate"}}
I have never worked with jquery templates. But this syntax score: d = getScoreByMatch($data, true) will work in javascript.
I just introduced a variable to get the result from the getScoreByMatch() method, and then assign that value to the variable to the score property.
I'm not sure if this will work or not, but just try and see.
user405398
source share