How to Dynamically Replace/Reposition Division Field Created Through Accounting Dimension in Frappe?

I am working on a customization for the Payment Entry Doctype and need some help regarding the Accounting Dimension.

I want to control the position of the Division field when it is created through the Accounting Dimension. Specifically, I need the Division field to appear in a specific location (or section) only when certain conditions are met.
I am aware that I can use Customize Form to adjust the placement of the field, but I am looking for a way to do this dynamically when the Division field is created via the Accounting Dimension in the Payment Entry form.

My Goal:

Conditionally change the position of the Division field.
Reposition the field only when the Accounting Dimension is used.
How can I achieve this dynamically (e.g., using a custom script or server-side method)?

Any guidance on the best approach or existing examples would be really helpful!

Thanks in advance!