Nagle's algorithm was invented to solve problems of small packets by applications like telnet. I don't think chat application is much different than telnet.
However if consider applications like gaming, where we need to send updates on player's location, sending one coordinate and waiting for another second before sending another coordinate would result in very annoying lagging. The solution in this case would be to disable Nagle's algorithm like you said.
In socket API users can't set/reset push flag. It is managed by TCP layer. To disable Nagle's algorithm we need to set TCP_NODELAY = 1 by setsockopt system call.
If this solution will be applied here too then every chat will become an email.
No it won't. If you think about it, fastest typing speed of a human is 212 wpm which is about 3.5 words per second. Even if RTT in the Internet is 1 second (I pinged facebook.com and it was (avg/max) 77/95 ms, I also pinged University of Chile, Santiago, among the furthest cities from the city I live and it was 433/517 ms.) usage of Nagle's algorithm would not create problem here because user would have typed about 4 words by the time ack of first byte comes, which now we can send.