Yes, you can download the source code from sourceforge as described further down, so you should be able to change the source code of "edit.com". That being said, according to this information, if you're implementing more serious solutions (and not games), you may want to try other DOS emulators (emphasis mine):
What is the focus of DOSBox? According to its developers,
DOSBox is focused on DOS games. ... [and] ... If you want to run
serious DOS applications within a DOS emulator, you'd better try
dedicated emulators such as vDos and vDosPlus instead, which are
designed to run DOS applications rather than games.
The DOSBox wiki is here.
According to this wiki page, SVN_Builds,
The official DOSBox SVN repository is hosted at sourceforge.net:
https://sourceforge.net/projects/dosbox/
EDIT:
To get a snapshot of the source code, you can go to this link, "Tree => DOSBox", and click on "Download Snapshot". You will have to wait until it gathers the snapshot, in my case about two minutes, and then it will give you a "Save As..." dialog box, and you save the zip file where you want it.
I took a quick look in the directory structure, and through the source code, and could not find the "EDIT.COM" command within DOSBox. That means it is a ".COM" file from some other source (unless I'm missing something). You still might be able to find the source for it, but you would have to look elsewhere.
The good news is, since you have the source code for DOSBox itself, you should be able to patch it to look at whoever modifies or opens any file for editing / reading / writing for any purpose, not just using the "EDIT.COM" command, which is more robust anyway. HTH.