You can probably do this using callbacks, but it would be very inefficient.
Example (I haven't tested this; having a callback equal to the timestep may not work):
dt = 0.1
sim.setup(timestep=dt)
p = sim.Population(N, sim.IF_cond_exp())
def sinusoidal_threshold(t):
p.set(v_thresh=-50 + sin(t))
return t + dt
sim.run(t_stop, callbacks=[sinusoidal_threshold])
It would be much more efficient to implement a model with time-varying threshold in the backend simulator(s) you want to use - Brian, NEST or NEURON, and then wrap it for PyNN.
Cheers,
Andrew