Queuing is an agreement with the supplier of a service to order their customers. As customers we agree to comply with their terms of service by queuing.
A customer who has to fill in a form, obviously needs to do this offline from the queue. If they agree with the person at the till, to return as a high priority case then pushing into the queue is acknowledging this exception. If on the other hand the customer has no agreement, by default they have to join the queue.
This often happens in supermarkets while things are returned because of damage and a new item collected. This also makes sense.
On the other hand filling in forms, processing them is not a quick process and therefore going to the back of the queue is not unreasonable.
So your behaviour was perfectly acceptable, unless the lady in question had an agreement with the person at the till to put her details as a higher priority.
The complexity of forms etc. is a judgement call between you and the assistant. I have filled name and address on simple forms and taken others away. There is no one rule. What is most efficient works. There are many jokes about filling in forms and going to back of queues....