Fix execution order with "names" in relation to other states

Fixes #13312. Used fractional parts of floats to ensure correct sort
order. The issue with previous solution to use `order + name_order` was
that all states come with preassigned `order`, and thus `order + name_order`
will conflict with the `order` of the following states. This solution limits the
maximum value of `name_order` to 9999 before the same issue arises again.

I don't quite understand why `order_chunks` is duplicated twice. I updated
both instances.