I suspect that the gunship was simply programmed to shoot the closest hostile entity, which happened to be the player's rockets. This kind of emergent behavior is actually quite common in gameplay programming. In any case, machine learning was not involved in the development of Half-Life.