Argh, sorry - missed your post before.
In the latest trunk, lines 292 to 306 set the VLAN configuration. You'll want to replace those lines with:
rt305x_esw_set_vlan_id(esw, 0, 1);
rt305x_esw_set_vlan_id(esw, 1, 2);
rt305x_esw_set_vlan_id(esw, 2, 3);
rt305x_esw_set_pvid(esw, RT305X_ESW_PORT4, 2);
rt305x_esw_set_pvid(esw, RT305X_ESW_PORT3, 3);
BIT(RT305X_ESW_PORT0) | BIT(RT305X_ESW_PORT1) |
BIT(RT305X_ESW_PORT2) | BIT(RT305X_ESW_PORT6));
BIT(RT305X_ESW_PORT4) | BIT(RT305X_ESW_PORT6));
rt305x_esw_set_vmsc(esw, 2, BIT(RT305X_ESW_PORT3) | BIT(RT305X_ESW_PORT6));
This sets port 3 (physically labelled port 1, next to the WAN port) to VLAN 2, whereas the WAN port is VLAN1 and port 2-4 are VLAN0.
For D4's there is no need to revert the network drivers as per the post you linked - in fact it wouldn't work anyway as the directory structure has been changed recently. So basically this is enough:
svn co svn://svn.openwrt.org/openwrt/trunk/
Course you'll need to do the feeds script if you want luci, etc. and frankly there's a lot of crap selected by default you can strip, I've managed to knock a full 1MB off the build size giving a lot more to play around with post-install.