If you have a MediaWiki page to change it, it is normally within the terms, if not the you are likely not meant to touch it. Adding extra stuff in is also normally within the terms, although there are grey areas with this.
The things are full of commercial stuff and im alright with this. However, the ADs are just a little bit annoying compared to a free space on the right.
So. Would my wiki get banned if i modify rightbar rail so ADs still would be showed but text will fill empty areas? Yeah i know its against the rules but that change would not affect THE POINT of this rule.
Do you mean let the text overflow into the sidebar space assuming there's no sidebar modules there? If so, I believe it's allowed, more based on how some tables already do that if they're too wide and there's space for them to use.
Also, your wiki wouldn't get banned for braking ToU, staff would just remove the offending script and slap you on the wrist. If it happens lots of times.... who knows.