Is this code sample called at posting time or at the time the post is displayed on the forum?
You are rigth. The code is called during the submission of the posting and not on displaying.
Or I could allow unregistered users to post images and simply allow the parsing to eat the disallowed tags, right?
If this button change really is necessary
No, it is an optical part. The img-button becomes useless for unregistered users.
Can you at least list the source file and the identifier(s) near where I would do this?
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences