Hi Kiran Iserbelas,
Try this
SELECT T1.[AvgPrice] FROM OITM T0 INNER JOIN OITW T1 ON T0.ItemCode = T1.ItemCode WHERE T0.ItemCode=convert(character (40),(select $[$38.1])) and T1.[WhsCode] =convert(character (40),(select $[$38.24])) and (select ocrd.QryGroup1 from ocrd where cardcode =convert(character (40),(select $[ordr.cardcode]))) ='Y'
change BP Property according to your requirement
Above Query will automatically reflect Avg Price in Sales Order. this will solved your 1st Case, For second part you have to elaborate process through which specific price is linked to the BP.
regards,
Raviraj