How to deny database acess to windows autentication users
If the users are administrators, there is no way to keep them out.  This could be sysadmin on the server, dbo on the database, etc.

The easiest way to keep other (non-Administrator) logins out of your database is to never grant them rights or (as one part of your code suggests) drop any users that are not 'automacao' or some other needed service logins.

Also, rather than cycling through every securable, you can use (assuming SQL Server 2005 and forward) is to grant at the database level. E.g.

 GRANT EXECUTE ON DATABASE::YourDB TO automacao