Conditional keybinding behaviour with packages

I want to use ‘enter’ for both snippets and autocomplete.

If there’s an autocomplete suggestion selected/available, I want enter to use it to autocomplete.

If there’s no autocomplete suggestion available, I want ‘enter’ to go to the next snippet tab stop.

I’ve currently set it up with the following keybinding:

‘atom-text-editor:not([mini])’:
‘enter’: ‘snippets:next-tab-stop’

This solves the snippets issue, but doen’t prioritize autocomplete suggestions.
I think this might be doable using the init.coffee file, but the autocomplete I’m working with here is the one in “language-haskell”, and I don’t know how to interact with it from the init file.

Any suggestions?