You may need to adjust the context a bit, but this should be the beginning. This is based on the key pairing of the automatic pair for inline brackets.
{ "keys": ["*"], "command": "insert_snippet", "args": {"contents": "*$0*"}, "context": [ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|;|\\}|$)", "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["*"], "command": "insert_snippet", "args": {"contents": "*${0:$SELECTION}*"}, "context": [ { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }, { "keys": ["*"], "command": "move", "args": {"by": "characters", "forward": true}, "context": [ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "^\\*", "match_all": true }, { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true } ] }