Automatically add semi-colons in JavaScript after callbacks in Sublime Text 2

How often do you type the following bit of code when programming in JavaScript?
myFunction(a, b, function() {

})

In Sublime Text 2, the default action is for Sublime to automatically add the closing bracket and parentheses, then move the cursor to the middle line and indent.

This means you have to press the down arrow key, add a semi-colon, press the up arrow key, then press tab again to get back to where you want to be coding.

To have Sublime automatically insert a semi-colon after typing the above code, save the following code to /Users//Library/Application Support/Sublime Text 2/Packages/User/Default (OSX).sublime-keymap

[
  { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/User/Add Line in Braces.sublime-macro"}, "context":
    [
      { "key": "setting.auto_indent", "operator": "equal", "operand": true },
      { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
      { "key": "preceding_text", "operator": "regex_contains", "operand": "\\) \\{$", "match_all": true },
      { "key": "following_text", "operator": "regex_contains", "operand": "^\\}\\)", "match_all": true },
      { "key": "selector", "operator": "equal", "operand": "source.js"}
    ]
  }
]

If you're interested in learning what all of that means, check out the Sublime Text 2 unofficial documentation on key bindings

Edit: The below code is edited so that semi-colons are inserted not just after a function passed as an argument, but also in function declarations. It also WON'T add a semi-colon if the declaration is inside an object ({send: function() {} })

[
		{ "keys": ["ctrl+j"], "command": "join_lines" },
	  { "keys": ["shift+super+alt+f"], "command": "show_panel", "args": {"panel": "replace"} },
	  { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/User/Add Line in Braces.sublime-macro"}, "context":
	    [
	      { "key": "setting.auto_indent", "operator": "equal", "operand": true },
	      { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
	      { "key": "preceding_text", "operator": "regex_contains", "operand": "function.*\\) \\{$", "operator": "not_regex_contains", "operand": ":", "match_all": true },
	      { "key": "following_text", "operator": "regex_contains", "operand": "^\\}\\)*", "match_all": true },
	      { "key": "selector", "operator": "equal", "operand": "source.js"}
	    ]
	  }
	]