Open ImgBurn, go to Build mode, Advanced tab -> Media tab, choose Custom double-layer profile and enter a large number for both Max Sectors in L0 and Media Capacity, then close ImgBurn to save those settings. That way you'll never be asked about the layerbreak again.
Also install the latest ImgBurn version, if you haven't already, and change /BUILDMODE IMAGEFILE to /BUILDOUTPUTMODE IMAGEFILE. You can also remove /ROOTFOLDER "YES" since ImgBurn detects DVD-Video content and won't ask about the root.
ImgBurn doesn't have a DLL or an API, but it does have the command line switches, which you can find all of them listed in ImgBurn's Read Me.