This worked just fine with my current router versions WRT54G v2.2 to 3.1.
Today I received a new WRT54GL (v4.0) and loaded v23 SP1 on it.
As I tried the code mentioned above but I could not get switch port 4 to run on a seperate VLAN interface.
Does anybody know what has changed? Could it be some changed nvram variables in the firmware or is the configuration not supported anymore in a WRT54GL?