Hi,
Never seen such a complex code to achieve simple things. Seems you did not follow advice from Alexis about creating agents from csv. I suggest you to please look at models library with example csv_agents.gaml about how to import attributes as species variables and to discard the header row.
Also please carefully understand scope of local and global. Why do you have species inside a global block ?
Follow those examples and you can solve your problem. I suggest you practise all the examples of data_importation and those in save_statement, at least those related to csv files.
regards,
Srirama