(Sorry for the questions, my elisp isn't so good.)

Why indent extra here?

If you'd like to make the regex match Ninja's behavior, the difference between $foo and ${foo} is the difference between "simple_varname" and "varname" as defined here:
https://github.com/martine/ninja/blob/master/src/lexer.in.cc#L132