Ideally you'd make it all one single module (or at least one that uses included modules) instead of using CHAIN, since limitations of the past don't apply to QB64 anymore in regard to module size, but it seems you want Qbasic support on DOSbox, is that right?
In the occurrence you really are avoiding qb64 altogether, you'll have to chain back to the main program. You'll also probably need some COMMON variables to keep the program's state across CHAIN calls.
PS: QB64 does emulate CHAIN but doesn't use shared memory. All data transfer is done via a file on the disk.