Hmm… a very interesting grammar question.
In the first sentence, “The last time I was heard speaking English fluently was when my grade-school assistant principal visited me in the ICU,” the preposition “in” is not used between “speaking” and “English” because here, “English” is being used as an adjective modifying the gerund “speaking.” With such a construction in the form “gerund + adjective + adverb,” the implied sense is that the speaker speaks English fluently as a matter of course.
On the other hand, in the second sentence, “But that incident made me conscious of a divide between Filipinos who prefer speaking in English and those who prefer speaking in Tagalog,” the preposition “in” is used between “speaking” and “English” and between “speaking and “Tagalog” because in both instances, “English” and “Tagalog” are being used as objects of the preposition “in.” In this form, the implied sense is that the speaker has a choice of speaking either in English or Tagalog, and vice versa. This sense is, in fact, emphasized by the verb “prefer,” in such a way that the preposition “in” becomes functionally necessary to link the verb with the alternative objects “English” or “Tagalog.”
In informal English, however, these grammatical distinctions often get blurred without causing sentence dysfunction. In the first sentence you presented, the phrase “speaking English fluently” can also use “in” without raising eyebrows and yield practically the same sense: “The last time I was heard speaking in English fluently was when my grade-school assistant principal visited me in the ICU.” So with knocking off the “in” in the phrases “prefer speaking in English” and “prefer speaking in Tagalog” in the second sentence: “But that incident made me conscious of a divide between Filipinos who prefer speaking English and those who prefer speaking Tagalog.” English has the flexibility and tolerance for such minor deviations in syntax in evoking the same sense, so they really shouldn't cause us to lose sleep.