At this time (Saturday 6/1/24 @ 11 pm Eastern), Thinkorswim is having some issues displaying the data. So I was not able to test this on the custom watchlist column. But I did test it as a chart study and that worked. Please let me know if you find anything that doesn't seem right, once Thinkorswim gets their temporary outage cleared up.
On Thinkorswim, each candle is marked with the starting time of each bar. So when we reference a time of 10:00 it will be the bar the opens at that time. And this also is going to be impacted by the time frame you select for the watchlist column.
Which means you must select a time frame which evenly divides into the target time you have selected. For example, a target time of 10 am will work on a 1 min, 2, min, 5 min, 10 min and 30 min time frame. But it will not work if the time frame is set to 3 min, 4 min or 15 min time frame. That is not a complete list, but it should help yo understand the limitation of using this type of tool.
Here is the solution you requested:
input targetTime = 1000;
def targetBar = SecondsFromTime(targetTime) == 0;
rec targetPrice = if targetBar then open else if SecondsFromTime(targetTime) >= 0 then targetPrice[1] else Double.NaN;
plot percentChange = 100 * (close / targetPrice - 1);
AssignBackGroundColor(if percentChange > 0 then Color.GREEN else if percentChange < 0 then Color.RED else Color.CURRENT);
Please note I have this set to display "NaN" until the target time has been exceeded. Otherwise the value it would display prior to 10 am would be computed from the 10 am bar of the previous trading session.