Don't worry you're not using functions at all (those are called routines). After that first GOSUB you have an END. You don't want to END the program after every GOSUB because when Darkbasic sees RETURN it'll go to the next line after the GOSUB so if it sees an END the program will stop.
On Menu2 when you want to go back to Menu1 just type RETURN. Or if their within a DO/LOOP (which they should be in some kind of loop) you can use EXIT to leave the DO/LOOP and let the RETURN at the end of the routine to take you back to Menu1.
Your pseudo-code:
Do
Check Mouse X,Y position
Code to be executed here.
Loop
Menu1:
do
If button1 clicked then Gosub Menu2
If button2 clicked Quit
end
endif
loop
Return
Menu2:
do
If button3 clicked RETURN or EXIT
If button4 clicked Quit
End
endif
loop
Return
In this learning phase it's ok to have code that's inefficient. As you learn more and more about Darkbasic Pro you'll get better trust me. Just have fun right now and don't worry if you have few routines that seem a bit awkward.