The issue seems to be that the document context does not exist while the document is being created which is why you are not able to use a standard macro. Instead, it should be possible to check the NodeID in the querystring, and only allow the document to be created under specific node IDs. The macro would look something like the following (where ==4 is your document node id): QueryString.GetValue("parentnodeid")==4
You can check which NodeID is being used by your documents under the Properties tab. Would this approach work for you?
Please let me know if you have any additional questions.