That's one way of doing it. There's a similar plugin that auto posts from RSS feeds: https://github.com/barisusakli/nodebb-plugin-rss
So perhaps you can change the code where it parses an RSS feed to reading the twitter feed instead. Or use an twitter to RSS service like https://twitrss.me/
If you wrote an IFTTT plugin though, that would be pretty cool
Looks like your plugin will reject any user with a non-gmail account. Maybe you should check with a list of valid email domains, i'm sure you can find one easily on google.
Actually I think this is a bad idea. Because anyone can run their own mailserver.
Just check if the email contains an @ is enough for valid email testing. Most regex solutions will fail on stuff like:
"this email contains spaces"@example.org which is a valid email address. An email address may even contain a @ character in the local part in some odd configurations.