I see a couple things that might be causing issues. Are you getting any errors or is it just not working?
First, leave the serial.begin stuff out. Embrio uses the Serial stuff do communicate while in connection mode, so that could maybe be interfering.
Make sure you're source files (like Adafruit_MotorShield.h and .cpp) are added to the project using the form in view -> Include Files. You might want to either move Adafruit_PWMServoDriver.h to a root folder so you can remove the "utility" part, or add the utility folder using the "Load Folders" button on the include folder.
Once it's working, you'll want to control the speed with an input activation, do that by transforming an activation to the range of 0 to 255.
Below is a quick node I put together. Note that I didn't test this because I don't have the hardware or source files, but I think it should work. You can copy and paste the below XML into a node screen editor in Embrio (an easier way to share than writing out the code again).
Let me know if that works or you're still stuck!
<EmbrioCopy>
<Version>1.3.2.0</Version>
<Nodes>
<Node>
<UniqueID>c77c96e5-9384-40b0-bfcc-8d32f96d0776</UniqueID>
<AssemblyType>Embrio.NodeEngine.AgentController.Nodes.AgentControllerCustomArduinoNode</AssemblyType>
<NodeType>Custom Arduino Node</NodeType>
<UserDefinedName></UserDefinedName>
<Description>A node that lets you write any Arduino code to interact with the Arduino hardware. Can be both an input and output.</Description>
<NodeColor>144,183,227,255</NodeColor>
<X>0</X>
<Y>0</Y>
<Width>516</Width>
<IncludeCode>#include "Wire.h"
#include "Adafruit_MotorShield.h"
#include "Adafruit_PWMServoDriver.h"</IncludeCode>
<DeclerationCode>Adafruit_MotorShield AFMS = Adafruit_MotorShield();
Adafruit_DCMotor *myMotor = AFMS.getMotor(4);
</DeclerationCode>
<SetupCode>AFMS.begin(); // create with the default frequency 1.6KHz
// Set the speed to start, from 0 (off) to 255 (max speed)
myMotor->setSpeed(150);
myMotor->run(FORWARD);
// turn on motor
myMotor->run(RELEASE);</SetupCode>
<ImageName>arduino.png</ImageName>
<InfoURL></InfoURL>
<IsOpen>True</IsOpen>
<EditWidth>360</EditWidth>
<CodeDefinitions>
<CodeDefinition>
<UpdateCondition>InputChange</UpdateCondition>
<Code>myMotor-&gt;run(FORWARD);
myMotor-&gt;setSpeed(transform(Input_Activation, 0.0, 1.0, 0, 255)); </Code>
<UniqueID>5542eb34-9f3f-4bd2-a3f2-e64cddc351b2</UniqueID>
<Inputs>
<Input>86f21152-f85e-4f9c-8a2a-24077bb1e5cf</Input>
</Inputs>
</CodeDefinition>
</CodeDefinitions>
<Inputs>
<Input>
<UniqueID>86f21152-f85e-4f9c-8a2a-24077bb1e5cf</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Activation</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>Numeric</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.NumericNodeInput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>True</IsUserAdded>
<ConnectedOutputs></ConnectedOutputs>
<BlendMode>Add</BlendMode>
<DisconnectedValue>0</DisconnectedValue>
<UseNegativeRange>False</UseNegativeRange>
<CanUseNegativeRange>True</CanUseNegativeRange>
</Input>
</Inputs>
<Outputs></Outputs>
</Node>
</Nodes>
</EmbrioCopy>