Why loop through the entity list?
CSGO is based on the source engine. The player structure contains a variable which indicates the player within your crosshair. This variable is called m_iCrossHairID.
This variable contains the PlayerID of the entity which is within your crosshair at that point in time. By knowing the entity which is in your crosshair, you can gather information about, for instance the team of the entity. This can be compared to your own team to know if the entity is an enemy.
If so, you can let your cheat shoot for you, resulting in a sort of auto shoot cheat. The advantage of triggerbots is that they are fast. As soon as an enemy enters your crosshair, your cheat can automatically shoot. It's often used for awping.
You can add a delay where ever you want, it's most likely used to not shoot instantly, otherwise it would be way too suspicious.