runmotor:
high portb.1
pause 3000
low portb.1
end

This will run your motor for 3 seconds to portb.1 and end.
You have to be a lot more specific if you want any more help