As far as telling CodeBlocks to output to a different folder, this is easy. In the workspace browser on the left (the pane with the list of files), and find the icon for the project (it's the one that's bolded, usually, and has the icon that looks like the CodeBlocks logo).
Right click this icon and go to Properties. Click on the Build targets tab in the window that appears. On the right, under Output filename, you may set the filename and path where the final DLL file is written.
As far as launching a DLL automatically, there isn't any way to specify it on the command line if that's what you mean. What you can do is, press the D key at the main menu. The debugging menu will appear. Click Run Script, and then select the DLL file to run.
This has a few problems however (namely, in multiplayer missions, if there are Last One Standing triggers, the game will stop immediately. You either have to comment out the trigger creation code temporarily, or just launch the DLL from the multiplayer menu manually).
For single player missions, there shouldn't be any problems testing them through this method.
If you're testing multiplayer missions and need to test them the usual method (by creating a TCP/IP game with one copy of the game, and joining with another), you can save a few keystrokes if you run the game with the following command line option:
/net:winsock
This will bring the game directly to the TCP/IP host/join selection dialog, which saves a couple of mouse clicks from when the game starts. Unfortunately, there isn't any way to automate it further (with more command line options, for example). (It is possible to load other network providers directly in this manner, by changing the part after the colon. For example, /net:sigs would attempt to load the sigs provider immediately. There are other provider names for Modem, IPX, and Serial but they escape my memory at the moment (dplay_ipx might be the IPX one but I doubt it). If you leave out the part after the colon, it will open directly to the multiplayer menu asking you to pick a connection type).