I cannot give you new features in the title formatting language, but I can provide you with some ideas on make the best of what is there.
Comments: A comment is essentially a piece of code which does not affect the output. The normal syntax rules should be relaxed or removed so we can write more naturally. Ideally a comment should have no negative performance impact.
In the title formatting language an expression must have the following properties to not affect the output: It must evaluate to the empty string and the boolean value false. (If we use it at the top level, the boolean value might be negligible.) It also must not have side effects. The performance only really matters, if the script is evaluated quickly for lots of tracks, e.g. in album list or a playlist.
Here are some of the functions I found with these properties:
# using "write-only" variables
$puts(COMMENT,this is a comment)
$puts(REM,for fans of batch scripts)
$puts(,the variable with the empty name)
# using string functions
$left(this is a comment,0)
$left(same but a little shorter,)
# using conditional blocks
[a comment without special characters in it]
['a comment with some special characters (,)%[]
and a line break']
[$(this is actually an unknown function error but the square brackets swallow it)]
The $puts version may be the most obvious comment, but it is the worst performance-wise (it has a side effect). Square brackets with quoted strings would be may favorite style-wise. $left with literal arguments will be optimized away by the title formatting compiler, so it should be optimal performance-wise. I don't remember whether the same optimization is applied for square brackets.
This optimization actually has a bug. The compiler replaces function calls with literal arguments by the value of the function call. Unfortunately it discards the boolean value. This is also what is happening with $not($not()). There are several ways around this. We could use variable access to produce true and false like so:
# initialize true at the start of the script
$puts(true,)
# $get returns false for undefined variables
$get(false)
# $get returns true for defined variables (and their string value)
$get(true)
However this feels rather clunky. Maybe we don't even need boolean literals. You used the pattern $and($if(A,true),B) in your script. That is actually the same as $if(A,B). You also do a case distinction on a numeric value in the range 1 to 5. We could use $select for this. The foo_skip plugin only cares about the string value we produce and will play the track, if it is "0" or the empty string. (Actually, the boolean value is not even accessible outside the title formatting script itself.) We could use this to make the script more readable. If we do all that you script could like like this:
$if($meta_test(duplicate),skip,
$if($meta_test(rating),
$ifgreater($select(%rating%,0,0,50,90,95),$mod($rand(),100),skip,[play]),
[play]))
I hope I could provide some ideas to make writing title formatting scripts more satisfying!