I'm sure there are more clever ways, but the way that immediately comes to mind is to sense a stall in movement. When it senses a stall, it would apply a small amount of force. If the stall is still present in some time after that, it applies more force, etc... Essentially, this is a PID loop focusing on the I term. The longer the error exists (stalled) the more proportional the force. And when the bar starts moving again, it begins applying less force.
A completely mechanical type of system that DIY bodybuilders have used is actually just using counterweights. Not enough weight to actually lift the bar, but enough to 'help' if needed. They arrange the pulleys in a slip configuration with some lag. As long as they have control of the movement and keep it moving, the counterweight does practically nothing. But if they stall, the weight of the bar brings the counterweight into the loop.
BTW, here's another solution already available. I will see if I can find a link to the garage gym system with the counterweights I had come across before.http://www.shermworks.com/xanim.html