I don't know how you pick up items but use EVENT_IMPACT or EVENT_CLICK. In their event you increase a variable, let's say bonus_count by one. Use a global while loop to check when bonus_count >= 2. If so, loop over all entities using
for(you = ent_next(NULL); you; you = ent_next(you)){...}.
In the loop you compare the entities' filenames using
str_for_entfile (STRING*, ENTITY*);
remove them if appropriate and reset the var afterwards.