It almost writes the word "Counter" to the page, but fails because of a tiny typo.
jsbeautified with comments
$ = ~ []; // -1
$ = {
___: ++$, // 0
$$$$: (![] + "")[$], // 'f'
__$: ++$, // 1
$_$_: (![] + "")[$], // 'a'
_$_: ++$, // 2
$_$$: ({} + "")[$], // 'b'
$$_$: ($[$] + "")[$], // 'd'
_$$: ++$, // 3
$$$_: (!"" + "")[$], // 'e'
$__: ++$, // 4
$_$: ++$, // 5
$$__: ({} + "")[$], // 'c'
$$_: ++$, // 6
$$$: ++$, // 7
$___: ++$, // 8
$__$: ++$ // 9
}; // make a lookup of funny names to hex digits
$.$_ = ($.$_ = $ + "")[$.$_$] + ($._$ = $.$_[$.__$]) + ($.$$ = ($.$ + "")[$.__$]) + ((!$) + "")[$._$$] + ($.__ = $.$_[$.$$_]) + ($.$ = (!"" + "")[$.__$]) + ($._ = (!"" + "")[$._$_]) + $.$_[$.$_$] + $.__ + $._$ + $.$; // 'constructor'
$.$$ = $.$ + (!"" + "")[$._$$] + $.__ + $._ + $.$ + $.$$; // 'return'
$.$ = ($.___)[$.$_][$.$_]; // Function (constructor function object)
$.$( // create new function from string...
$.$( // create new function from string...
$.$$ + "\"" + $.$$_$ + $._$ + $.$$__ + $._ + "\\" + $.__$ + $.$_$ + $.$_$ + $.$$$_ + "\\" + $.__$ + $.$_$ + $.$$_ + $.__ + ".\\" + $.__$ + $.$$_ + $.$$$ + $.__ + "\\" + $.__$ + $.$_$ + $.__$ + $.__ + $.$$$_ + "('\\" + $.__$ + $.___ + $._$$ + $._$ + $._ + "\\" + $.__$ + $.$_$ + $.$$_ + $.__ + $.$$$_ + "\\" + $.__$ + $.$$_ + $._$_ + "');" + "\""
// 'return"docu\155e\156t.\167t\151te('\103ou\156te\162');"'
)() // returns "document.wtite('Counter');"
)(); // executes document.wtite('Counter');
Whoops.
This isn't a malicious script in itself, but it could well be something returned by an access monitoring script used by malware, or an inactive malware drop (eg one that only attacks a different browser), pretending to be a web beacon.
To spoil your fun, there is an online decoder for this particular obfuscation script here.