I was able to accomplish this relatively easily by using an add'l field from the source and then performing a resolve function in AD to populate the 'manager' field. Each employee record in our Oracle HR DB has an attribute for not only their own EmployeeID, but for that of their supervisor. Our Oracle people simply made that 'supervisorID' attribute available in the view they constructed for our synch. A resolve/lookup is performed against the employee's 'supervisorID', which (in the DTM resolve) maps to the 'employeeID' of the supervisor in AD. Once this <supervisor's> employee ID is resolved, the value is returned (in DN format) and populated into the 'Manager' field as a normal 'Lastname, Firstname' format in the AD User Object.
This is dependent on the 'employeeID' being populated for every user, but once it's there, it works like a charm. I'm assuming you're setting this up be able to handle ongoing updates/changes. Once you get this running any changes/updates in the HR DB are automatically reflected in AD the next time the DTM job runs. There was NO scripting in this. Just use the 'resolve' function and make sure you tell DTM that the supervisorID <source> is actually their employeeID <target>, and THAT's what you want to pull from and populate into the AD 'manager' field.
Good Luck!