There are a number of ways you can solve your problem, the following solution is one of them.
1. You can a JavaScript Array to store all the information about your teams.
/* Initialise the Array used to store information about each team. */
<<set $teams to []>>
2. You can use a JavaScript Generic Object to store multiple facts about each team within the array.
/* Add the first team to the Array. */
<<run $teams.push({
name: "Team 1",
score: 10
})>>
/* Add the second team to the Array. */
<<run $teams.push({
name: "Team 2",
score: 13
})>>
/* Add the third team to the Array. */
<<run $teams.push({
name: "Team 3",
score: 7
})>>
3. You can use the JavaScript Array.sort() function to order the teams within the array based on each team's score value.
<<run $teams.sort(function (a, b) {
return a.score - b.score;
})>>
4. You can use the range variation of the <<for>> macro to loop through each of the teams within the sorted array, so you can built a HTML table structure to display each team's information.
<<nobr>>
<table>
<tr><th>Team</th><th>Score</th></tr>
<<for _team range $teams>>
<tr><td>_team.name</td><td style="text-align: right;">_team.score</td></tr>
<</for>>
</table>
<</nobr>>