The original Java code uses Matcher.quoteReplacement, which deliberately stops / and $ from having any special meaning:
https://code.google.com/p/htmlcompressor/source/browse/trunk/src/main/java/com/googlecode/htmlcompressor/compressor/HtmlCompressor.java (line 469)
The C# version is using match.Result which is doing token replacement, such that “$$” becomes “$”. This would cause similar problems if any variables were named, or started with, “$1”.
C# doesn’t have an equivalent of quoteReplacement, so you could probably resort to using Replace, as you only need to escape / and $ (rather than using Regex.Escape).
So, in ServiceStack/Html/Minifiers.html.cs (forum won’t let me link more than 2 things!)
sb.Append(match.Result(scriptBlocks[i].Replace("\\", "\\\\").Replace("$$", "$$$$")));