Saving form in managed code can be achieved by executing submit connection. I don't understand why this is unappropriate solution for you? Before executing that submit connection you can change its FolderUrl property, so the form will be saved wherever you want to (into actual library for example).
In loading event you can get url of actual ...