Hi Stefan!
Have a look here:
http://laytheme.com/documentation.html#custom-javascript
When using jQuery, please use "jQuery" instead of "$".
Do not insert jQuery by yourself using <script src="jquery.js"></script>", because jQuery is already included. If you insert jQuery another time, this will cause bugs.
You can put all of your custom JavaScript into "Lay Options" → "Custom CSS & HTML" → "Custom <head> content". Don't forget to wrap your JavaScript with <script> … </script>.
To your second question:
Laytheme is developed as a single-page-Javascript-Page. That means that the stats plugin might get confused
I will check this!
Best!
Marius