Yup. A twitch extension is just a website, and it can do ban/sub checks before delivering the code to the user.
And do random rolls to pick viewers are random, etc/so on
Possibilities are endless. You can prototype it off twitch and change it into an extension.