Hi,
More or less yes.
Some parts are good but I see some little "mistakes".
The best will be to just replace the first line you modified by
$my_amount = strlen($product->amount);
And then
foreach($product->prices as $k => $price){
$product->amount = $product->prices[$k]->price_value + $my_amount;
So for the rest of the price assignations, the product->amount will be used correctly.
You can put a category filtering on the custom item field.
So you can use an hidden HikaShop category to regroup all product affected by the item custom field.
Regards,