Correct AJAX practices
First of all, you have way too many questions in here. I recommend breaking this problem up into smaller chunks and trying to solve them each, rather than dumping this whole novel into stack exchange for someone to solve all your problems for you.

Maybe that sounds harsh, but there's a reason you don't have any replies yet.

I can point you toward the Drupal's once function, which will help you address at least your onLoad conundrum. (Hint: you should not be using onLoad, ever.)

In general if you're building a site in Drupal, and you can't find a module to do what you want, and you find yourself writing a lot of PHP or javascript or custom what-have-you, you might want to consider a new approach. 

There are lots of front-end frameworks that probably offer libraries to accomplish the behavior you're trying to achieve. Try finding one that comes close to solving your problem, performs well under load, and then adapt it for your use.