|Freeze-ups after a time period are classic symptoms of overheating.|
If you touched the fan and it started running then it was obviously getting the right message from the computer but had got jammed. So, yes, you need to replace the fan.
There is just a chance that if you remove the sticker (if any) from the spindle end and apply a drop of oil it might fix it. The other possibility is excessive dirt on the blandes. However if it keeps stopping it could wreck the CPU so the safest advice is to replace it.
I doubt there is/was a software issue at all.
Please come back and let us know how you got on.