Just look at the function call.
Code:
--calls
-- oUF_CreateDragFrame(framename,movable,locked,anchorframe,anchorframename,anchorpoint,xpos,ypos)
oUF_CreateDragFrame("oUF_TargetDragFrame",1,0,target,"oUF_Target","CENTER",0,0)
You are calling the function with locked = 0. To lock it the 0 has to be 1. Its an example only. You need to replace the values with variables that stand for your move or lock-status.
Something like this. Your player and target variables and global names may be named differently too.
Code:
--calls
local moveplayer = 1
local lockplayer = 1
oUF_CreateDragFrame("oUF_PlayerDragFrame",moveplayer ,lockplayer ,player,"ouf_player","CENTER",0,0)