Updating a density distribution
The functions you use (kde, dkde, hpi, ...) do not seem to be standard R functions and you are not very explicit on your exact data structur, so it's hard to help. Could you provide more info on that (packages used, ...)?

What I think to realize though - but correct me if I'm wrong - is the following. When substituting h1 in the second line of your loop with its function body, you could simplify the function and get rid of all exp and log, which should speed up your script at least a bit:

    exp( h1(thetas) - h1(theta.mh[i1-1,s,t]) )
--&gt; exp( log(p1(...)*p2(...)) - log(p1(...)*p2(...)))
--&gt; exp(log(p1(...)*p2(...))) / exp(log(p1(...)*p2(...)))
--&gt; p1(...)*p2(...) / p1(...)*p2(...)


that means, what your second line actually computes is:

p1(y[s,t],thetas)*p2(thetas) / p1(y[s,t],theta.mh[i1-1,s,t])*p2(theta.mh[i1-1,s,t])


I hope that is of some use to you...