Well... I'd rather try to help you learn to do this yourself, rather than do it for you. I think I've put enough in this post to get you started. Feel free to post scripts you come up with for help!
Anyway, the idea behind this script is that the way the animations are set up, a weapon on the back
has to be a two-handed weapon (or else the character will attempt to draw it from his waist and leave it on his back). However, you can change the weapon's handedness while it is drawn. So you want the weapon to be treated as a two-hander while sheathed, and then switch to a one-hander once it's been fully drawn. You then have to switch it back to being two-handed before it's sheathed. This all can be done with a combination of OBSE functions.
Basing this on the reach of the weapon is trivial (though you may get weapons you don't intend), as OBSE has a function to do that.
The functions you'd use, probably, are http://cs.elderscrolls.com/constwiki/index.php/GetEquippedObject, http://cs.elderscrolls.com/constwiki/index.php/GetWeaponReach, http://cs.elderscrolls.com/constwiki/index.php/IsWeaponOut, http://cs.elderscrolls.com/constwiki/index.php/DisableControl/http://cs.elderscrolls.com/constwiki/index.php/EnableControl, http://cs.elderscrolls.com/constwiki/index.php/OnControlDown, http://cs.elderscrolls.com/constwiki/index.php/TapControl, and http://cs.elderscrolls.com/constwiki/index.php/SetWeaponType. I recommend http://cs.elderscrolls.com/constwiki/index.php/Scripting_Tutorial:_My_Second_Script for learning the basics of scripting. The trickiest part if likely going to be disabling the "Draw/Sheathe" control while you've got the spear drawn, detecting when the player tries to sheathe it, change its type back to two-handed, and re-enable and tap the Draw/Sheathe key.