I think what i would do is to define a new deferral code table with the setup needed to meet the business requirements.
Then i would add a related field on the sales header to assign the deferral code to the sales headers.
I then would post the sales orders through the standard posting routine.
I would have done the deferral posting in a separate batch job that i would run regularly through the job queues.
So that would be my brief specification for this. Let me know if you need more assistance around some actual code.