As Jeffrey said, dont try to reinvent the wheel, check out the SEOmoz keyword difficulty tool.
Otherwise you can look at these parameters:
- What is the current rank of the keyword?
- Number of hits at Google?
- Competition on Adwords (https://adwords.google.com/o/Targeting/Explorer?__c=1000000000&__u=1000000000&ideaRequestType=KEYWORD_IDEAS)
- Compare the onpage with the competitors
- Compare incoming links with the competitors
Combine all of these parameters to get an idea of the difficulty.
Good luck!