How best to implement a custom variable in the content creation form in D7? I'm creating a sports league site. 

I want to have a variable behind the scenes containing the current league standing. In a content type 'result', upon saving, I first want a field (previous standing) to be populated with this variable, and then for the variable to be updated with the new standing. But I have no idea where to even begin with this!
I believe your best bet is to create your own module, with a custom form hook and the form submit which will process your data and do all your calculations and save the new value. The form tutorials in the Form API Examples can give you a lot of good insight how to do this.