Senior IDF commander says Hamas operative was spotted crossing border fence with gun, but firefight was conducted carefully and slowly to ensure no friendly fire