You can track target changes with a 0,0 page.
Give the page dynamicdata "/GameData.Target.Window" it will now show whenever the target window is susposed to be shown.. If you hide it everytime it is shown then it will open every time the target window is opened (i.e. every time the target is changed)..
I dunno about the lock
Might be able to do something like this in the page.
OnActivate="activated=false target_previous"
OnShow="visible=false OnActivated=Parent.LockCheckbox.Checked"
Hope that helps a little
edit:
Capturing experience gain is harder but can be done with a few side-effects:
http://www.eq2interface.com/forums/s...ead.php?t=3929
But maybe the code I used there can be added to a experience window in another sub-page of the HUD and keep it functionality (e.g. inventory.experience). I never tried that.