something like
set x to (((ID) mod [5]) * [50])
set y to (([floor v] of ((ID) / [5])) * [30])
should get you a lot closer to your objective