Ok. Here is some modified code below. But, this may only work in single player. I believe disableAI/enableAI only works where the unit is local. If the AI is not in a human player's group it is local to the server only and this command will not work in MP (I think). So, if you intend this for MP and it doesn't work we have to look at a way to get the unit local (make him part of the human player's group), getting the script to run on the server, or possibly looping the restrained animation until released. All three are possible but let's not put the cart before the horse. Try this first and see how it works. As you can see, I only added one line of new code to each script. Two caveats: In restrain.sqf Hopefully the restrained animation kicks in fully before the disableAI command or it will lock out the change. If it doesn't, you might need to add a sleep command or other safety catch between the playMove and disableAI command. Also for release.sqf once enableAI runs it maybe unnecessary to use the playMove command if you say that not he gets up as soon as he goes down. If so, you can just remove the code. Play with it and see. Good luck!
// restrain.sqf
private ["_target", "_id"];
_target = _this select 0; // The unit to be restrained.
_id = _this select 2; // The index number of the action.
// Make the target be bound to the ground.
_target playMove "ActsPercMstpSnonWnonDnon_ArrestingManLoop";
// Prevent the target from changing animation states.
_target disableAI "ANIM";
// Remove the "Restrain" action so you don't restrain a unit more than omce at a time.
_target removeAction _id;
// Add an action to free the target.
_target addAction ["Free Target", "release.sqf"];
// release.sqf
private ["_target", "_id"];
_target = _this select 0; // The unit to be freed
_id = _this select 2; // The index number of the action.
// Enable the target to change animation states.
_target enableAI "ANIM";
// Make the unit stand normally.
_target playMove "AmovPercMstpSnonWnonDnon"; // This may not be needed anymore.
// Remove the "Free Target" action so you don't free a unit more than omce at a time.
_target removeAction _id;
// Add an action to restrain the target again if needed.
_target addAction ["Restrain", "restrain.sqf"];