In:
function remove_bullet()
{
if(EVENT == EVENT_BLOCK){ent_remove(me);}Take EVENT_BLOCK instead of EVENT_BOUNCE (not sure if EVENT_BOUNCE even exists, sorry)
...

Or in the while loop of function move_bullet():

if(IN_SOLID){ent_remove(me);}

Sorry, my former answer was a bit unspecific.