Just to explain what was at issue with the original script, check out this from the documentation of IS_SRVROLEMEMBER:
If a Windows login, such as Contoso\Mary5, is specified for login, IS_SRVROLEMEMBER returns NULL, unless the login has been granted or denied direct access to SQL Server.
So, since those logins had not been granted direct access, IS_SRVROLEMEMBER was returning NULL when you passed them in as the login parameter. In the revised script, you are not passing a login parameter, and as the above link goes on to explain, then it is able to resolve indirect memberships.
Cheers!