Legality of third party IM API
Stackoverflow is not a layer; Stackoverflow is not your label; only your lawyer can provide legal advice. Don't ask Stackoverflow for legal advice.
Many people do this; Pidgin, Adium, Meebo, etc. Ask your lawyer if it is legal where you live. Just because MSN says something on the site that you can't do it, that doesn't mean it's illegal.
source to share
Part 4 of the MSN Terms of Service states this (abbreviated):
4 How you can not use the service.
use any unauthorized third party software or service to access Microsoft's instant messaging network (currently known as the .NET Messenger service);
So, I would say ad or not ad, you won't be allowed to connect to their network with anything other than Live Messenger because they don't publish API, so the only authorized client is theirs.
source to share
They can block / remove you from the network if you violate ToS. This is probably the only thing they will do because it is easy and effective for them.
Since you violated the ToS, there is no point in suing Microsoft for blocking your service. It depends on the country you live in if they can demand anything from you. But as long as you are not a large company, you will not be beneficial to them.
source to share