I decided to reply due to your certain reluctances.
OS X Mountain Lion, alone can use between 2-4 GBs of your installed 8 GBs of RAM.
OS X Mt. Lion is a serious CPU, GPU and RAM resource hog!
You maybe using half your RAM just for OS X activities leaving you with only an additonal 4 GBs of RAM for other third party applications. That is not a lot of RAM.
How many applications do you, usually, leave running in the background while using another application?
So, adding either another 4 or 8 GBs of additonal RAM may help with your situation.
It would still be prudent to run as few additonal applications as possible and maybe while gaming online, quit all applications you are not immediately using.
I know of Second Life.
This is an online game and is played exclusively through a web browser. Second Life is a pretty serious CPU, RAM and also pretty intense on the GPU. It also, probably, also needs Adobe Flash Player which is another big Mac and OS X resource hog.
So, the web browser with Adobe Flash active and running is a big Mac and OS X resource eater that is also running an online game that is, in additon, a big Mac and OS X resource eater at the same time.
Your Intenet connection could be adversely affecting game play, also, but if I recall, Second Life uses some serious graphics power. With only 512 MB of VRAM, Second Life could, also, be taxing your GPU.
Typically, high graphics style games, usually, need a better than a 512 MB VRAM GPU. High intensity graphics games, usually, scream for a 1 or 2 GB VRAM GPU. Unfortunately, you cannot upgrade the GPU in your iMac.
So, you maybe stuck graphics power-wise.
Your best bet is, even with the additonal RAM, is to keep the amount of running background apps to a minimum and make sure your Internet connection is of sufficient speed for playing this online game.
Your Intenet connection can be adversely affected by the number of other Internet users accessing your ISP's servers at any particular time.
The more Intenet users tapping the servers and connection stream, the slower your Internet speeds/connection rate will be.