Wow that was friking amazing...
First cloud uses 2 "hero drinks" (using W-item) which will raise the strenght of your character in a battle, then barret uses ungarmax, and the tricky part comes after that... he seems to have a blue materia (which is unknown, might be quadra magic) and a mime master (one of them in every spot, functioning togheter), that will make barret mime a bunch of times... at first i though it was a counter like you al but counter was a pink materia i believe, this is a blue. besides barret doesn't attack after ruby hits him if you look carefully. he has mbarrier by the way (which i also don't know how because he never casts it and has no magic materia in his arsenal, the only possibility is that hero drinks also casted barrier and magic barrier but that's something i don't know). please some japanese schoolar come quick!!
by the way, whatever this trick is i'm sure it might have something to do with having the character after barret dead...