Sorry, I was very confused when I made the post. Of course I looked at the wiki but everything was not very clear to me.
The original problem I tried to describe and solve was some strange loop that appeared when I plugged a factory reset HAP into port 4. If this port was set to "optional", had vlan id that was not 1, and had the tag set to "leave as is", the switch did not accept the device. On the RSTP tab the port kept changing from "edge" to "point to point". Some kind of loop probably, but what exactly was going on?
I fixed it by putting the tag to "always strip". A factory reset HAP cannot understand vlan tags, of course... Still, I don't get exactly why the switch went crazy, and I want to know.