If the net isn't named (as in this case net 29) it can become a port but it won't be able to use "31" as the port name because 31 doesn't qualify as a user-given name. You need at least one "letter" in the name to qualify as user-given. If the "net" does happen to be named with a user given name (not a number) then the net name prevails over the port name anyway (if they are different). With these things in mind I think it will be impossible for you to specify numeric port names that are different from the system generated net ID's of the respective nets. I believe net names need to be user-given as well, so naming the net as "31" with a text label probably won't have the effect you want either.
Thank you Chris!