I wrap the back half of my top tube with the same bar tape I use on my bars.
This makes the bike "stick" to whatever I lean it against, and it protects the tube from scratches.
When the bar tape starts to shred and fray, I replace it.
The bar tape also turns the top tube into a nice handle when picking up the bike, and it also provides a surprising amount of comfort when I put the top tube on my shoulder and walk with the bike.