There's a problem with using {2,10} in the same line since it has a comma. You need to put the pattern into a variable and use that instead.
alias checksteam {
var %r = /^STEAM_[0-1]:[0-1]:\d{2,10}$/
return $regex($1-,%r)
}
Returns 1 if valid and 0 if not. There's certainly no need to use an if-else here.
if (1) and if ($true) are essentially the same, as are if (0) and if ($false).
So, using this in another script:
if ($checksteam(id)) will be false if it returns 0 and true if it returns 1.