The way dreamweaver works, you have to give a weight to each server behavior... and that weight can't change. The weight is a number from 1-100 (recordset's have a weight of 50)... then based on the weight the server behavior is placed on the page.
We have to assign a weight to each server behavior and then DW is supposed to place it accordingly.
When it comes to an insert, there are two possible scenarios. You may want the insert to occur before the recordset... because you might want to display the results that you just inserted on the page. If you put the insert after the recordset, then the results that you inserted wouldn't be displayed because the insert took place after.
Now in your case you are inserting a value from a recordset... so you want the insert to take place after the recordset. We had to make a judgement call to decide which scenario would work by default and which would require moving the code chunk after application to the correct position. Our thoughts were that the first scenario is more common... since most people don't insert from a recordset but many display from one on the same page.. and that the second scenario is a more advanced application, so it is more reasonable that people doing that could figure out that they needed to move the insert below because they are more advanced users.
The reality is that sometimes in Dreamweaver when you need things to happen in a particular order, you need to adjust the order of the code manually. There is no way for us to fix this because it is just the way dreamweaver works. It isn't a bug. It is a limitation in the extensibility model Dreamweaver supports when applying server side code.