Here is what I'm currently doing.
TeamCity does have the variable, it's named %vcsroot.url%, but it's available to scrips as default.
To make it available in the msbuild script (and other types as well).
Goto project settings -> Parameters -> Add new parameter
Name: system.vcsroot.url
Kind: System property
Value: %vcsroot.url%
And you have property as $(vcsroot_url) in msbuild