Steam is probably the reason why you lag. I have personally never used Steam for RotMG or plan to, but from what I know Steam is linked to your Realmofthemadgod.com account. You can easily set-up a flash projector with version 18 and use the link to get it working. Though, this requires effort.
Anyway, if you find yourself having increasing amounts of lag go ahead and restart the application.