I have written an application that will properly install a folder in the Dock as a menu. I did it by reverse engineering the array "persistent-others" in the preference file "com.apple.dock.plist". I have not tried this with an application, so I don't know how to do this, but reverse engineering the array "persistent-apps" ought to yield something useful.
Here's the handler I used ...
on addDockMenu(folderAlias)
-- 1 construct the |file-data| record
set folderPath to (POSIX path of folderAlias)
if (last character of folderPath) = "/" then
set folderPath to (text 1 thru -2 of folderPath)
end if
set newFileData to {|_CFURLString|:folderPath, |_CFURLStringType|:0}
--2 construct the |tile-data| record
tell application "Finder" to name of folderAlias
set newTileData to {arrangement:0, displayas:1, |file-data|:newFileData, |file-label|:the result, |file-type|:2, showas:3}
-- 3 construct the newMenuFolderItem record
set newMenuFolderItem to {|tile-data|:newTileData, |tile-type|:"directory-tile"}
-- 4 write to Dock preference file
set prefsFile to (((path to preferences from user domain) as text) & "com.apple.dock.plist") as alias
tell application "System Events"
set dockPath to (prefsFile as text)
set dockRec to (value of property list file dockPath)
set |persistent-others| of dockRec to ((|persistent-others| of dockRec) & {newMenuFolderItem})
set (value of property list file dockPath) to dockRec
end tell
tell application "Dock" to quit
end addDockMenu -----------------------------