Custom JavaScript Editor plugin is a powerful official WordPress release that add a JavaScript editor you can use for easily adding custom Javascripts in your WordPress install direct from your admin area dashboard.
Install and activate Custom JavaScript Editor. After activation visit admin area Dashboard -> Appearance -> Custom Javascript page and here you can add your Javascript code. Your code gets stored and revisioned with a custom post type, so you can always go back to a previous working state.