Bran, you've provided lots of code, but we can't run it. If your question is specific to your code, make sure you provide code we can run. If your question is about how to make a rectangle, one way is to use the rectangle command:
rectangle('position',[12 10 8 5],'facecolor',[0.53 0.43 0.79])
If you need to set the transparency of a patch object, you can do so like this:
h = patch([12 20 20 12 12],[10 10 15 15 10],[0.53 0.43 0.29]);
set(h,'facealpha',0.5)