My approach would be to first get the starting point to draw the rectangle. First I'd need to setup a state listening for "Mouse Button Down" which transitions into a state which grabs the Mouse X & Y Positions and translates that to world space and Activates our Selection Box. We'll transition into a new State waiting for "Mouse Button Up" whilst grabbing the mouse X & Y Positions every frame and translating them to world space. We'll revisit this state in a moment and add more stuff, but first, I should explain what our "Selection Box" is made of.
Our selection box prefab is a meshless 3d cube with a trigger attached and a pivot point in the corner, rather than the centre. It needs an FSM attached checking for Entry and Exit events against Units (have them tagged). When a unit enters the trigger, add it to an array. When it leaves, remove it from the array.
Now we know what the box is, we'll go back to the state grabbing the Mouse position whilst waiting for the player to release the mouse button.
We can use the Get and Set Property Actions to adjust the size of the selection box's collider based on the mouse position. Do this each frame whilst waiting for "Mouse Button Up"
When the player releases the mouse, it'll transition to a new state which Deactivates the selection box game object. You're left with an array of Units which you can loop through with your commands.
I reccommend first getting to grips with Arrays before tackling the selection box side. So when you click a unit to select it, instead of just saving it as a game object variable as you have done already, also save that game object variable to an Array. When it comes to issuing commands, use the "Array get Next" action to loop through it and apply the command to each unit.