I've heard this phrase mainly in old movies. From the context, I inferred that it was a mild form of swearing and not considered terribly offensive.
However, I'm not sure what the 'it' in 'beat it' referred to. Going by colloquial expressions such as 'beat the meat', I can only think of one logical answer to that. If it means what I think it means, it's a lot less mild than it sounds.
I feel that the usage of the phrase has declined drastically, as one hears it a lot less often currently. So it's difficult to correctly gauge the usage pattern now.
If someone could please shed some light on the historic context, meaning and current usage status of the phrase, that would be great. How offended should I be when someone tells me to 'beat it'?