Here's another thought. In addition to doing your Edit form as you do now why not allow us to define an edit form with straight HTML and you pop that form up instead? This way the clunky css to position fields is lost and we will have complete freedom on how the form looks. The form would be populated as at present.
This thought came to me because I now want to put boxes around related fields and maybe change background color. I haven't tried yet but I suspect this is going to take some doing.
BTW I am suprised that the formating of an edit form hasn't reared it's ugly head before this as it is a basic requirement of any commercial app.